/* ====================================================================
   ALZAR MOBILE SCHEDULE
   Calendar + day-items view for the Schedule tab on mobile.
   ==================================================================== */

/* ── Page shell ─────────────────────────────────────────────────────── */
.msc-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ── Calendar wrapper ───────────────────────────────────────────────── */
.msc-cal-wrap {
    flex-shrink: 0;
    background: var(--color-bg-surface, #1a1a2e);
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
}

.msc-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 6px;
}

.msc-cal-month-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-main, #e0e0e0);
    flex: 1;
    text-align: center;
}

.msc-cal-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.msc-cal-nav-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--color-border, rgba(255,255,255,0.10));
    background: var(--color-bg-hover, rgba(255,255,255,0.06));
    color: var(--color-text-main, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.msc-cal-nav-btn:active { background: rgba(14,165,233,0.15); }

.msc-cal-today-btn {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--color-primary, #0ea5e9);
    background: transparent;
    color: var(--color-primary, #0ea5e9);
    cursor: pointer;
    font-family: var(--font-base, inherit);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.msc-cal-today-btn:active { background: rgba(14,165,233,0.12); }

/* ── Calendar grid ───────────────────────────────────────────────────── */
.msc-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0 12px 8px;
    gap: 1px;
}

.msc-cal-dow {
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--color-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.msc-cal-cell {
    position: relative;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-base, inherit);
    color: var(--color-text-main, #e0e0e0);
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
    padding: 0;
}
.msc-cal-cell:active { background: var(--color-bg-hover, rgba(255,255,255,0.08)); }

.msc-cal-cell.other-month {
    color: var(--color-text-muted, #888);
    opacity: 0.4;
}

.msc-cal-cell.is-today {
    font-weight: 700;
    color: var(--color-primary, #0ea5e9);
}

.msc-cal-cell.selected {
    background: var(--color-primary, #0ea5e9);
    color: #fff;
    font-weight: 600;
}

.msc-cal-cell.is-today.selected {
    background: var(--color-primary, #0ea5e9);
    color: #fff;
}

/* Dot indicator for dates with items */
.msc-cal-dot {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-primary, #0ea5e9);
    pointer-events: none;
}

.msc-cal-cell.selected .msc-cal-dot {
    background: rgba(255, 255, 255, 0.75);
}

/* ── Day section ─────────────────────────────────────────────────────── */
.msc-day-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.msc-day-header {
    flex-shrink: 0;
    padding: 10px 14px 6px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.06));
}

.msc-day-summary {
    font-size: 12px;
    color: var(--color-text-muted, #888);
    line-height: 1.4;
}

.msc-day-summary strong {
    color: var(--color-text-main, #e0e0e0);
    font-size: 13px;
}

.msc-overdue-badge {
    color: #ef4444;
    font-weight: 600;
}

/* ── Filter chips ────────────────────────────────────────────────────── */
.msc-filter-row {
    display: flex;
    gap: 6px;
    padding: 6px 0 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.msc-filter-row::-webkit-scrollbar { display: none; }

.msc-filter-chip {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--color-border, rgba(255,255,255,0.12));
    background: transparent;
    color: var(--color-text-muted, #888);
    font-size: 12px;
    font-family: var(--font-base, inherit);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.msc-filter-chip.active {
    background: var(--color-primary, #0ea5e9);
    border-color: var(--color-primary, #0ea5e9);
    color: #fff;
}

/* ── Day list (scrollable) ───────────────────────────────────────────── */
.msc-day-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px;
}

.msc-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--color-text-muted, #888);
    font-size: 13px;
    line-height: 1.6;
}

/* ── Item rows ───────────────────────────────────────────────────────── */
.msc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.05));
}

.msc-item.is-clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.msc-item.is-clickable:active {
    background: var(--color-bg-hover, rgba(255,255,255,0.04));
}

.msc-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.msc-item-icon.job-icon {
    background: rgba(14, 165, 233, 0.14);
    color: #0ea5e9;
}

.msc-item-body {
    flex: 1;
    min-width: 0;
}

.msc-item-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-main, #e0e0e0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.msc-item-title.done {
    text-decoration: line-through;
    opacity: 0.45;
}

.msc-item-meta {
    font-size: 11px;
    color: var(--color-text-muted, #888);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msc-item-overdue {
    color: #ef4444;
    font-weight: 600;
}

/* ── Status chip (jobs) ──────────────────────────────────────────────── */
.msc-status-chip {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: capitalize;
}

/* ── Task checkbox ───────────────────────────────────────────────────── */
.msc-task-check {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-text-muted, #888);
    font-size: 22px;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    border-radius: 6px;
}
.msc-task-check:active { background: rgba(255,255,255,0.06); }
.msc-task-check.done { color: #22c55e; }

/* ── FAB ─────────────────────────────────────────────────────────────── */
.msc-fab {
    position: fixed;
    bottom: 76px;
    right: 16px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-primary, #0ea5e9);
    color: #fff;
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35);
    z-index: 100;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s, box-shadow 0.15s;
}
.msc-fab:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

/* ── Quick-add bottom sheet ──────────────────────────────────────────── */
.msc-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 400;
    display: flex;
    align-items: flex-end;
    animation: msc-fade-in 0.15s ease;
}

@keyframes msc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.msc-sheet {
    width: 100%;
    background: var(--color-bg-surface, #1a1a2e);
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    animation: msc-slide-up 0.2s ease;
}

@keyframes msc-slide-up {
    from { transform: translateY(60px); opacity: 0.4; }
    to   { transform: translateY(0);    opacity: 1;   }
}

.msc-sheet-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 16px 20px 10px;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
}

.msc-sheet-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: none;
    color: var(--color-text-main, #e0e0e0);
    font-size: 15px;
    font-family: var(--font-base, inherit);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-align: left;
}
.msc-sheet-option:active { background: var(--color-bg-hover, rgba(255,255,255,0.06)); }

.msc-sheet-option i {
    font-size: 22px;
    color: var(--color-primary, #0ea5e9);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.msc-sheet-cancel {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-top: 1px solid var(--color-border, rgba(255,255,255,0.08));
    background: none;
    color: var(--color-text-muted, #888);
    font-size: 14px;
    font-family: var(--font-base, inherit);
    cursor: pointer;
    margin-top: 4px;
    -webkit-tap-highlight-color: transparent;
}
.msc-sheet-cancel:active { background: rgba(255,255,255,0.04); }
