/* ===== CalendarWeekView Component (dashboard) ===== */

.cwv-grid-inner {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cwv-header-row {
    display: flex;
    border-bottom: 1px solid var(--border-strong);
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
}

.cwv-header-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px 6px;
    gap: 2px;
    border-right: 1px solid var(--border);
}

.cwv-header-cell:last-child {
    border-right: none;
}

.cwv-header-cell.cwv-today {
    background: var(--surface-alt);
}

.cwv-header-day {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ink-muted);
    letter-spacing: 0.4px;
}

.cwv-today .cwv-header-day {
    color: var(--accent);
}

.cwv-header-date {
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
}

.cwv-today-badge {
    background: var(--accent);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.cwv-time-gutter {
    min-width: 58px;
    max-width: 58px;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.cwv-header-row .cwv-time-gutter {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.cwv-time-label {
    font-family: var(--font-ui);
    font-size: var(--text-xs);
    color: var(--ink-muted);
    text-align: right;
    padding: 2px 6px 0 10px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: flex-start;
}

.cwv-body {
    position: relative;
}

.cwv-columns {
    display: flex;
}

.cwv-day-col {
    flex: 1;
    position: relative;
    border-right: 1px solid var(--border);
    min-height: 0;
}

.cwv-day-col:last-child {
    border-right: none;
}

.cwv-today-col {
    background: rgba(91, 33, 182, 0.03);
}

.cwv-hour-line {
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
}

.cwv-event {
    position: absolute;
    border-radius: var(--radius-pill);
    padding: 3px 6px;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-left: 3px solid;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    box-sizing: border-box;
}

.cwv-event:hover {
    z-index: 2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 27, 68, 0.12);
}

.cwv-event-confirmed {
    background: rgba(91, 33, 182, 0.10);
    border-left-color: var(--accent);
}

.cwv-event-confirmed:hover {
    background: rgba(91, 33, 182, 0.18);
}

.cwv-event-cancelled {
    background: rgba(192, 57, 43, 0.08);
    border-left-color: var(--danger, #c0392b);
    opacity: 0.55;
}

.cwv-event-cancelled:hover {
    background: rgba(192, 57, 43, 0.14);
    opacity: 0.75;
}

.cwv-event-completed {
    background: rgba(39, 174, 96, 0.10);
    border-left-color: var(--success, #27ae60);
}

.cwv-event-completed:hover {
    background: rgba(39, 174, 96, 0.18);
}

/* origin icon in front of the time: sparkles = booked by the assistant, calendar = customer's Google Calendar */
.cwv-event-source {
    width: 11px;
    height: 11px;
    margin-right: 4px;
    vertical-align: -1px;
    opacity: 0.85;
}

/* the customer's own Google Calendar event: neutral, striped, so the assistant's bookings stand out */
.cwv-event.cwv-event--google {
    background:
        repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--ink-faint, #a99fb6) 14%, transparent) 6px 12px),
        var(--surface, #fff);
    border: 1px solid var(--border-strong, #d9cde6);
    border-left: 3px solid var(--ink-faint, #a99fb6);
    color: var(--ink-secondary, #3a2e4a);
}

.cwv-event.cwv-event--google:hover {
    background:
        repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--ink-faint, #a99fb6) 22%, transparent) 6px 12px),
        var(--surface, #fff);
}

.cwv-event.cwv-event--google .cwv-event-time,
.cwv-event.cwv-event--google .cwv-event-title {
    color: var(--ink-secondary, #3a2e4a);
}

.cwv-event-time {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    color: var(--ink-muted);
    white-space: nowrap;
}

.cwv-event-title {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cwv-event-confirmed .cwv-event-time {
    color: var(--accent);
}

.cwv-event-cancelled .cwv-event-time {
    color: var(--danger, #c0392b);
}

.cwv-event-completed .cwv-event-time {
    color: var(--success, #27ae60);
}

/* legend next to the week navigation (calendar appointments drawer) */
.giana-calendar-appointments-drawer__legend {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

/* "Mostra appuntamenti esterni" switch (drawer toolbar, Appuntamenti page toolbar) */
.giana-appointments-external-switch {
    flex-shrink: 0;
    gap: 8px;
}

.giana-appointments-external-switch .giana-switch__label {
    font-size: var(--text-sm);
    white-space: nowrap;
}
