/* ========================================
   SCHEDULE CARD - STRICT CONTAINMENT
   ======================================== */

.schedule-card {
    cursor: pointer;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    min-height: 56px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden !important;
}

.schedule-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    z-index: 10;
}

.schedule-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden !important;
}

/* Card rows - strict containment */
.card-top-row {
    width: 100%;
    max-width: 100%;
    gap: 0.35rem !important;
    overflow: hidden !important;
    box-sizing: border-box;
}

/* Store number - always fully visible, never truncated */
.store-number {
    font-size: clamp(0.6rem, 1vw + 0.3rem, 0.75rem) !important;
    font-weight: bold !important;
    flex: 0 0 auto !important;
    min-width: fit-content !important;
    max-width: none !important;
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
    overflow: visible !important;
}

.store-number span {
    white-space: nowrap !important;
    overflow: visible !important;
    max-width: none !important;
}

.store-number .bi-shop {
    font-size: clamp(0.65rem, 1.1vw + 0.3rem, 0.8rem);
    flex-shrink: 0;
}

/* Crew section - shrinks so the store number stays fully visible */
.crew-right {
    font-size: clamp(0.6rem, 1vw + 0.3rem, 0.75rem);
    min-width: 0;
    flex: 1 1 0;
    overflow: hidden !important;
}

.crew-stack {
    width: 100%;
    max-width: 100%;
    overflow: hidden !important;
}

.top-crew-row {
    width: 100%;
    max-width: 100%;
    overflow: hidden !important;
}

.main-crew,
.top-first-assist,
.assist-item {
    font-size: clamp(0.6rem, 1vw + 0.3rem, 0.75rem) !important;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.assist-list {
    width: 100%;
    max-width: 100%;
    overflow: hidden !important;
}

/* Bottom row - PMM and duration */
.d-flex.justify-content-between.align-items-start {
    width: 100%;
    max-width: 100%;
    overflow: hidden !important;
    box-sizing: border-box;
}

/* PMM values container - strictly contained */
.pmm-values-container {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 45px);
    overflow: hidden !important;
}

/* Key chips - contained within PMM container */
.key-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden !important;
}

.key-chip {
    font-size: clamp(0.55rem, 0.9vw + 0.25rem, 0.7rem) !important;
    padding: 0.05rem 0.3rem !important;
    white-space: nowrap;
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* PMM badges (L3/UPC) - contained */
.pmm-badges-container {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
    max-width: 100%;
    align-items: flex-start;
    overflow: hidden !important;
}

.pmm-badge {
    font-size: clamp(0.55rem, 0.95vw + 0.25rem, 0.7rem) !important;
    padding: 0.15rem 0.4rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    width: fit-content;
    line-height: 1.4;
    display: inline-block;
}

/* Duration - fixed width */
.duration-text {
    font-size: clamp(0.6rem, 1vw + 0.3rem, 0.75rem) !important;
    white-space: nowrap;
    flex-shrink: 0;
    width: 35px;
    text-align: right;
}

/* Limit containment to flex containers inside schedule cards. */
.schedule-card 
.d-flex {
    max-width: 100%;
    overflow: hidden;
}

.flex-wrap {
    overflow: hidden !important;
}

.flex-shrink-1 {
    min-width: 0 !important;
}

/* Status background colors */
.status-scheduled {
    background-color: #e5f4e3 !important;
    border-color: #5cb85c !important;
}
.status-scheduled .bi-shop,
.status-scheduled .fw-bold {
    color: #2e7d32;
}

.status-assisting {
    border-left-color: #0d6efd !important; /* Bootstrap primary blue */
    background-color: #cce5ff;
}
.status-assisting .bi-shop,
.status-assisting .fw-bold {
    color: #0277bd;
}

.status-rejected {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
}
.status-rejected .bi-shop,
.status-rejected .fw-bold {
    color: #842029;
}

.status-in-review {
    background-color: #fff8e1 !important;
    border-color: #ffca28 !important;
}
.status-in-review .bi-shop,
.status-in-review .fw-bold {
    color: #f57f17;
}

.status-pending-approval {
    background-color: #fff3e0 !important;
    border-color: #fd7e14 !important;
}
.status-pending-approval .bi-shop,
.status-pending-approval .fw-bold {
    color: #fd7e14;
}

.status-finalized {
    background-color: #d1e7dd !important;
    border-color: #198754 !important;
}
.status-finalized .bi-shop,
.status-finalized .fw-bold {
    color: #0f5132;
}

.status-blocked {
    background-color: #e5f4e3 !important;
    border-color: #5cb85c !important;
}
.status-blocked .bi-flag,
.status-blocked .fw-semibold {
    color: #2e7d32;
}
.status-blocked .fw-semibold {
    color: #2e7d32;
}
.status-blocked .store-number {
    max-width: 100%;
}

/* Published — light lavender/lilac matching Figma */
.status-published {
    background-color: #e8d5f5 !important;
    border-left: 4px solid #9b51e0 !important;
    color: #4a148c;
}

/* AI Draft — yellow (per design direction; NOT the purple shown in the Figma mock) */
.status-ai-draft {
    background-color: #fff8e1 !important;
    border-color: #f5a623 !important;
    border-left: 4px solid #f5a623 !important;
}
.status-ai-draft .bi-shop,
.status-ai-draft .fw-bold {
    color: #7a5c00;
}

/* Calendar Header Navigation Buttons */
.nav-btn:hover {
    color: #000 !important;
    background-color: #f8f9fa !important;
}

.key-row {
    background: #F9FAFB;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.key-pill {
    background: #ffffff;
    border: 1px solid #e6eef6;
    border-radius: 10px;
    padding: 6px 10px;
    min-width: 56px;
    text-align: center;
    font-size: 0.85rem;
    color: #0b1723;
    box-shadow: none;
}

.key-arrow {
    font-size: 0.95rem;
    color: #6c757d;
    margin-left: 4px;
}

.l3-button {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid #e1ecf6;
    border-radius: 8px;
    height: 36px;
    padding: 0 .6rem;
    font-size: 0.9rem;
    color: #212529;
    gap: .5rem;
    min-width: 120px;
}

.l3-button .l3-badge {
    min-width: 30px;
    padding: 4px 8px;
    font-size: 0.82rem;
    color: #6c757d;
    border-right: 1px solid rgba(0,0,0,0.04);
}

.l3-label {
    max-width: 80px;
}

.l3-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: auto;
    background: #ffffff;
    border: 1px solid #e6eef6;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(29,41,53,0.08);
    z-index: 1000;
    max-height: 220px;
    overflow-y: auto;
    min-width: 140px;
}

.l3-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #16324f;
}

.l3-item:hover {
    background: #f4f8fb;
    color: #07203b;
}

.key-duration {
    font-size: 0.85rem;
    color: #6c757d;
}

.key-time input {
    height: 20px;
    line-height: 20px;
}

.key-time {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
}

.key-row .bi {
    vertical-align: middle;
}

@media (max-width: 520px) {
    .l3-button { min-width: 100px; }
    .l3-label { max-width: 60px; }
}

.pmm-badge,
.key-chip {
    width: fit-content !important;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
}

.pmm-badges-container,
.key-chips-container,
.pmm-values-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    max-width: 100%;
}

/* ========================================
   READ-ONLY CARD OVERRIDES
   ======================================== */
.readonly-card {
    background-color: #E5E7EB !important;
    border-left-color: #9CA3AF !important;
    color: #4B5563 !important;
    cursor: not-allowed !important;
}

/* Force inner text and icons to be muted */
    .readonly-card .bi bi-shop me-1,
    .readonly-card .fw-bold,
    .readonly-card .fw-semibold,
    .readonly-card .key-chip,
    .readonly-card .pmm-badge,
    .readonly-card .text-secondary {
        color: #6B7280 !important;
    }

/* ========================================
   AI DRAFT — yellow status (Yellow 100 / Yellow 700)
   ======================================== */
.status-ai-draft {
    background-color: #FFF7DD !important;
    border-color: #A07300 !important;
    border-left: 4px solid #A07300 !important;
}
.status-ai-draft .bi-stars,
.status-ai-draft .fw-bold {
    color: #A07300;
}