/* ========== HEADER ========== */
.app-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.app-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.app-header__title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.app-header__subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: var(--touch-min);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: all var(--duration-fast) var(--ease-out);
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-accent);
    color: #fff;
}
.btn--primary:hover {
    background: var(--color-accent-hover);
}

.btn--secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn--secondary:hover {
    background: var(--gray-200);
}

.btn--danger {
    background: var(--color-critical);
    color: #fff;
}
.btn--danger:hover {
    opacity: 0.9;
}

.btn--sm {
    min-height: 36px;
    padding: var(--space-xs) var(--space-md);
    font-size: var(--text-xs);
}

.btn--icon {
    padding: var(--space-sm);
    min-width: var(--touch-min);
}

/* ========== SERVICE CARD ========== */
.service-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
    min-height: var(--touch-min);
    -webkit-tap-highlight-color: transparent;
}

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

.service-card:active {
    transform: scale(0.98);
}

.service-card__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.service-card__icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.service-card__info {
    flex: 1;
    min-width: 0;
}

.service-card__name {
    font-size: var(--text-base);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.service-card__category {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* ========== ENHANCED PROGRESS BAR (card) ========== */
.progress-enhanced {
    margin-bottom: var(--space-md);
}

.progress-enhanced__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.progress-enhanced__pct {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-primary);
    min-width: 38px;
    text-align: right;
}

.progress-enhanced__pct-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.progress-enhanced__track {
    height: 14px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-enhanced__fill {
    height: 100%;
    width: 0%;
    border-radius: var(--radius-full);
    transition: width 1s var(--ease-out);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.22;
    z-index: 1;
}

.progress-enhanced__segments {
    display: flex;
    height: 100%;
    position: relative;
    z-index: 2;
}

.progress-segment {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 1.2s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.progress-segment--year {
    background: linear-gradient(135deg, var(--seg-year), var(--seg-year-light));
    border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.progress-segment--month {
    background: linear-gradient(135deg, var(--seg-month), var(--seg-month-light));
}

.progress-segment--day {
    background: linear-gradient(135deg, var(--seg-day), var(--seg-day-light));
}

.progress-segment:first-child:last-child {
    border-radius: var(--radius-full);
}

.progress-segment:last-child {
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.progress-segment:first-child {
    border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.progress-segment:first-child:last-child {
    border-radius: var(--radius-full);
}

.progress-segment__label {
    font-size: 8px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.03em;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.4s 0.8s var(--ease-out);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.progress-segment[style*="width"]:not([style*="width:0%"]):not([style*="width: 0%"]) .progress-segment__label,
.progress-enhanced:hover .progress-segment__label {
    opacity: 1;
}

/* Shimmer on segments */
.progress-segment::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: shimmer 2.5s ease-in-out 1.5s;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Legend */
.progress-enhanced__legend {
    display: flex;
    gap: var(--space-sm);
    margin-top: 4px;
    justify-content: center;
}

.progress-legend__item {
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

.progress-legend__item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.progress-legend__item--year::before  { background: linear-gradient(135deg, var(--seg-year), var(--seg-year-light)); }
.progress-legend__item--month::before { background: linear-gradient(135deg, var(--seg-month), var(--seg-month-light)); }
.progress-legend__item--day::before   { background: linear-gradient(135deg, var(--seg-day), var(--seg-day-light)); }

.progress-legend__item--year  { color: var(--seg-year); }
.progress-legend__item--month { color: var(--seg-month); }
.progress-legend__item--day   { color: var(--seg-day); }

/* ========== COUNTDOWN BLOCKS (card) ========== */
.service-card__countdown {
    text-align: right;
}

.countdown-blocks {
    display: flex;
    align-items: baseline;
    gap: 2px;
    justify-content: flex-end;
}

.countdown-block {
    display: flex;
    align-items: baseline;
    gap: 1px;
}

.countdown-block__num {
    font-weight: 700;
    line-height: 1;
}

.countdown-block__unit {
    font-size: var(--text-xs);
    font-weight: 500;
    opacity: 0.7;
}

.countdown-block--year .countdown-block__num  { font-size: var(--text-xl); color: var(--seg-year); }
.countdown-block--month .countdown-block__num { font-size: var(--text-xl); color: var(--seg-month); }
.countdown-block--day .countdown-block__num   { font-size: var(--text-xl); color: var(--seg-day); }

.countdown-block--year .countdown-block__unit  { color: var(--seg-year); }
.countdown-block--month .countdown-block__unit { color: var(--seg-month); }
.countdown-block--day .countdown-block__unit   { color: var(--seg-day); }

/* ========== CARD FOOTER & META ========== */
.service-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.service-card__status {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.service-card__days {
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1;
}

.service-card__days-label {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

.service-card__due-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

/* ========== DETAIL COUNTDOWN HERO (bottom sheet) ========== */
.detail-countdown-hero {
    text-align: center;
    padding: var(--space-lg) 0;
}

.countdown-hero-blocks {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.countdown-hero-block {
    text-align: center;
}

.countdown-hero-block__num {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    display: block;
}

.countdown-hero-block__label {
    font-size: var(--text-xs);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-top: 2px;
}

.countdown-hero-block--year  .countdown-hero-block__num,
.countdown-hero-block--year  .countdown-hero-block__label { color: var(--seg-year); }
.countdown-hero-block--month .countdown-hero-block__num,
.countdown-hero-block--month .countdown-hero-block__label { color: var(--seg-month); }
.countdown-hero-block--day   .countdown-hero-block__num,
.countdown-hero-block--day   .countdown-hero-block__label { color: var(--seg-day); }

.countdown-hero-sep {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--gray-300);
    align-self: flex-start;
    margin-top: 0.3rem;
}

.detail-countdown-hero__subtitle {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-top: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== DETAIL SEGMENTED BAR (bottom sheet) ========== */
.detail-segmented-bar {
    margin: var(--space-md) 0 var(--space-lg);
}

.detail-segmented-bar__track {
    display: flex;
    height: 28px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gray-200);
}

.detail-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: var(--text-xs);
    font-weight: 700;
    position: relative;
    min-width: 0;
    overflow: hidden;
}

.detail-seg span {
    white-space: nowrap;
}

.detail-seg--year  { background: linear-gradient(135deg, var(--seg-year), var(--seg-year-light)); }
.detail-seg--month { background: linear-gradient(135deg, var(--seg-month), var(--seg-month-light)); }
.detail-seg--day   { background: linear-gradient(135deg, var(--seg-day), var(--seg-day-light)); }

.detail-segmented-bar__labels {
    display: flex;
    margin-top: 6px;
    gap: var(--space-md);
    justify-content: center;
}

.detail-seg-label {
    font-size: var(--text-xs);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-seg-label::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.detail-seg-label--year::before  { background: linear-gradient(135deg, var(--seg-year), var(--seg-year-light)); }
.detail-seg-label--month::before { background: linear-gradient(135deg, var(--seg-month), var(--seg-month-light)); }
.detail-seg-label--day::before   { background: linear-gradient(135deg, var(--seg-day), var(--seg-day-light)); }

.detail-seg-label--year  { color: var(--seg-year); }
.detail-seg-label--month { color: var(--seg-month); }
.detail-seg-label--day   { color: var(--seg-day); }

/* Ripple */
.service-card .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(0,0,0,0.08);
    transform: scale(0);
    animation: ripple 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* ========== QUICK FILTERS ========== */
.quick-filters {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 1200px;
    margin: 0 auto;
}

.quick-filters::-webkit-scrollbar {
    display: none;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: 36px;
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.chip:hover {
    background: var(--gray-100);
}

.chip--active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.chip__count {
    background: rgba(0,0,0,0.1);
    padding: 0 6px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
}

.chip--active .chip__count {
    background: rgba(255,255,255,0.25);
}

/* ========== BOTTOM SHEET / MODAL ========== */
.bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
    pointer-events: none;
}

.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 90vh;
    background: var(--bg-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform var(--duration-normal) var(--ease-out);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet__handle {
    width: 36px;
    height: 4px;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    margin: var(--space-sm) auto var(--space-md);
}

.bottom-sheet__header {
    padding: 0 var(--space-lg) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-md);
}

.bottom-sheet__body {
    padding: var(--space-lg);
}

.bottom-sheet__close {
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    margin-left: auto;
}

.bottom-sheet__close:hover {
    background: var(--gray-100);
}

/* Desktop: centered modal */
@media (min-width: 768px) {
    .bottom-sheet {
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
        max-width: 560px;
        width: 90%;
        max-height: 80vh;
        border-radius: var(--radius-lg);
        transition: transform var(--duration-normal) var(--ease-out),
                    opacity var(--duration-normal) var(--ease-out);
    }

    .bottom-sheet.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .bottom-sheet__handle {
        display: none;
    }
}

/* ========== DETAIL SECTIONS ========== */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row__label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.detail-row__value {
    font-weight: 500;
}

.detail-progress {
    margin: var(--space-lg) 0;
    text-align: center;
}

.detail-progress__circle {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-md);
}

/* ========== CALENDAR ========== */
.calendar {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-primary);
}

.calendar__title {
    font-size: var(--text-lg);
    font-weight: 600;
    text-transform: capitalize;
}

.calendar__nav {
    min-width: var(--touch-min);
    min-height: var(--touch-min);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.calendar__nav:hover {
    background: var(--gray-100);
}

.calendar__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding: 0 var(--space-sm);
}

.calendar__weekday {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    padding: var(--space-xs) 0;
    text-transform: uppercase;
}

.calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    padding: 0 var(--space-sm) var(--space-sm);
}

.calendar__day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
    border-radius: var(--radius-sm);
    position: relative;
    cursor: pointer;
    min-height: 36px;
}

.calendar__day:hover {
    background: var(--gray-100);
}

.calendar__day--today {
    font-weight: 700;
    color: var(--color-accent);
}

.calendar__day--other {
    color: var(--text-muted);
}

.calendar__day-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
}

.calendar__day-multi {
    display: flex;
    gap: 2px;
    position: absolute;
    bottom: 2px;
}

/* ========== CALENDAR: VIEW TOGGLE ========== */
.calendar__header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.calendar__view-toggles {
    display: flex;
    gap: 2px;
    margin-left: auto;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 2px;
}

.calendar__view-toggle {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.calendar__view-toggle:hover {
    color: var(--text-primary);
}

.calendar__view-toggle--active {
    background: var(--color-accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.calendar__view-toggle--active:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

/* ========== CALENDAR: YEAR VIEW (12 mini months) ========== */
.calendar__year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg) var(--space-lg);
}

.calendar__mini-month {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    overflow: hidden;
}

.calendar__mini-month-title {
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: center;
    padding: var(--space-xs) 0;
    text-transform: capitalize;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--duration-fast) var(--ease-out);
}

.calendar__mini-month-title:hover {
    background: var(--gray-200);
}

.calendar__mini-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

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

.calendar__mini-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border-radius: 3px;
    transition: background var(--duration-fast) var(--ease-out);
    cursor: default;
}

.calendar__mini-day--empty {
    visibility: hidden;
}

.calendar__mini-day--today {
    font-weight: 700;
    box-shadow: inset 0 0 0 1.5px var(--color-accent);
}

.calendar__mini-day--has-events {
    cursor: pointer;
}

.calendar__mini-day--has-events:hover {
    filter: brightness(0.9);
}

/* ========== CALENDAR: MONTH DETAIL VIEW ========== */
.calendar__month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    padding: 0 var(--space-sm) var(--space-sm);
    background: var(--gray-200);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.calendar__month-day {
    background: var(--bg-primary);
    min-height: 90px;
    padding: var(--space-xs);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar__month-day--other {
    background: var(--bg-tertiary);
}

.calendar__month-day--other .calendar__month-day-num {
    color: var(--text-muted);
}

.calendar__month-day--today .calendar__month-day-num {
    background: var(--color-accent);
    color: #fff;
}

.calendar__month-day-num {
    font-size: var(--text-xs);
    font-weight: 600;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    margin-bottom: 2px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.calendar__month-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.calendar__month-event {
    font-size: 10px;
    line-height: 1.4;
    padding: 1px 4px;
    border-radius: 2px;
    background: var(--bg-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.calendar__month-event:hover {
    background: var(--gray-200);
}

.calendar__month-event-more {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 1px 4px;
}

/* ========== CALENDAR: RESPONSIVE ========== */
@media (max-width: 900px) {
    .calendar__year-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .calendar__year-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
        padding: var(--space-sm);
    }
    .calendar__month-day {
        min-height: 60px;
    }
    .calendar__month-event {
        font-size: 9px;
    }
    .calendar__mini-day {
        font-size: 9px;
    }
}

@media (max-width: 380px) {
    .calendar__year-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========== CALENDAR: DAY MODAL ========== */
.cal-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1500;
    opacity: 0;
    transition: opacity 250ms var(--ease-out);
    backdrop-filter: blur(2px);
}

.cal-modal-overlay.active {
    opacity: 1;
}

.cal-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    z-index: 1501;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 420px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}

.cal-modal.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.cal-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.cal-modal__date-num {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    min-width: 44px;
    text-align: center;
}

.cal-modal__date-day {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.cal-modal__date-month {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    text-transform: capitalize;
}

.cal-modal__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out);
}

.cal-modal__close:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.cal-modal__count {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--bg-tertiary);
}

.cal-modal__list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm) 0;
}

.cal-modal__item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-out);
}

.cal-modal__item:hover {
    background: var(--gray-50);
}

.cal-modal__item-color {
    width: 4px;
    height: 36px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.cal-modal__item-body {
    flex: 1;
    min-width: 0;
}

.cal-modal__item-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-modal__item-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.cal-modal__item-status {
    font-weight: 600;
}

.cal-modal__item-cat {
    background: var(--bg-tertiary);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
}

.cal-modal__item-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-out);
}

.cal-modal__item:hover .cal-modal__item-arrow {
    opacity: 1;
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--gray-800);
    color: #fff;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    transition: transform var(--duration-normal) var(--ease-out);
    pointer-events: auto;
    max-width: 360px;
}

.toast.show {
    transform: translateX(0);
}

.toast--success { border-left: 4px solid var(--color-ok); }
.toast--error   { border-left: 4px solid var(--color-critical); }
.toast--warning { border-left: 4px solid var(--color-warning); }

/* ========== FORMS ========== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.form-input, .form-select {
    width: 100%;
    min-height: var(--touch-min);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--duration-fast) var(--ease-out);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}

.form-input--error {
    border-color: var(--color-critical);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--color-critical);
    margin-top: var(--space-xs);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-height: var(--touch-min);
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-accent);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state__text {
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
}

/* ========== LOADING ========== */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: var(--space-xl) auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
