/* ===== Expo Console ===== */

/* Page wrapper */
.expo-page {
    min-height: 100%;
    background: #f7f7f8;
    animation: expoFadeIn 0.4s ease;
}

@keyframes expoFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.expo-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 50;
}

.expo-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 800px;
}

.expo-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.expo-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.expo-event-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
    line-height: 1.2;
}

.expo-company-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #B71C1C;
    line-height: 1.2;
}

.expo-subtitle {
    font-size: 0.85rem;
    color: #888;
    font-weight: 400;
}

/* Controls bar */
.expo-controls {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 1rem 1.5rem;
}


.expo-search-input {
    padding: 0.625rem 1rem;
    font-size: 0.95rem;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.expo-search-input::placeholder {
    color: #999;
}

.expo-search-input:focus {
    border-color: #B71C1C;
    box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.2);
}

/* Status filter dropdown */
.status-filter-select {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #222;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.status-filter-select:focus {
    border-color: #B71C1C;
    box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.15);
}

/* Order list */
.expo-order-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.no-orders {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
    font-size: 1rem;
}

/* ===== Order card ===== */
.order-card {
    position: relative;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: expoFadeIn 0.3s ease;
}

/* Summary row */
.order-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.order-summary-row:hover {
    background: #f9fafb;
}

.order-summary-left {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.order-detail-line {
    font-size: 0.9rem;
    color: #222;
}

.order-label {
    font-weight: 600;
    color: #888;
}

.order-summary-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.order-elapsed {
    font-size: 0.8rem;
    color: #888;
}

.expand-arrow {
    font-size: 0.7rem;
    color: #999;
    transition: transform 0.25s ease;
    display: inline-block;
}

.expand-arrow.open {
    transform: rotate(90deg);
}

/* Status badge */
.expo-status-badge {
    display: inline-block;
    padding: 0.25rem 0;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    width: 5.5rem;
    text-align: center;
}

.expo-status-badge.status-pending { background: #f3f4f6; color: #6b7280; }
.expo-status-badge.status-confirmed { background: #dbeafe; color: #1d4ed8; }
.expo-status-badge.status-in-progress,
.expo-status-badge.status-in_progress { background: #fef3c7; color: #92400e; }
.expo-status-badge.status-ready { background: #e0f2fe; color: #0369a1; }
.expo-status-badge.status-fulfilled { background: #dcfce7; color: #166534; }
.expo-status-badge.status-rejected { background: #fee2e2; color: #991b1b; }

/* Detail section */
.order-detail-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.order-detail-wrapper.open {
    grid-template-rows: 1fr;
}

.order-detail-inner {
    overflow: hidden;
}

.order-detail {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
    opacity: 0;
    transition: opacity 0.25s ease 0.05s;
}

.order-detail-wrapper.open .order-detail {
    opacity: 1;
}

.order-note-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.order-field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
}

.order-note-input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    outline: none;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.order-note-input::placeholder {
    color: #aaa;
}

.order-note-input:focus {
    border-color: #B71C1C;
    box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.15);
    background: #fff;
}

.order-estimate-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.order-estimate-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.order-estimate-input {
    width: 64px;
    padding: 0.625rem 0.5rem;
    font-size: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.order-estimate-input:focus {
    border-color: #B71C1C;
    box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.15);
    background: #fff;
}

.order-estimate-label {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
}

/* Items list */
.order-items-list {
    display: flex;
    flex-direction: column;
}

.item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.item-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.item-qty {
    font-size: 1rem;
    font-weight: 700;
    color: #B71C1C;
}

.item-name {
    font-weight: 700;
    font-size: 1rem;
    color: #111;
}

.item-unit-price {
    font-size: 0.85rem;
    color: #888;
}

.item-price {
    font-weight: 600;
    color: #222;
}

/* Order-level action buttons */
.btn-order-complete {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #dcfce7;
    color: #166534;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-order-complete:hover:not(:disabled) {
    background: #bbf7d0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-order-complete:disabled {
    background: #e5e7eb;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-order-reopen {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fef3c7;
    color: #92400e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-order-reopen:hover {
    background: #fde68a;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-order-confirm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #dbeafe;
    color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-order-confirm:hover:not(:disabled) {
    background: #bfdbfe;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-order-progress {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fef3c7;
    color: #92400e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-order-progress:hover:not(:disabled) {
    background: #fde68a;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-order-ready {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #e0f2fe;
    color: #0369a1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-order-ready:hover:not(:disabled) {
    background: #bae6fd;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-order-reject {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fee2e2;
    color: #991b1b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-order-reject:hover:not(:disabled) {
    background: #fecaca;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* Detail footer */
.order-detail-footer {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid #f0f0f0;
}

.order-detail-footer button {
    flex: 1;
    text-align: center;
}

/* ===== Rejection modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: overlayFade 0.2s ease;
}

@keyframes overlayFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-title {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #222;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: #888;
    margin: 0;
}

.modal-form-group {
    margin-top: 1rem;
}

.modal-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}

.modal-label .required {
    color: #B71C1C;
}

.modal-textarea {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    resize: vertical;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.modal-textarea::placeholder {
    color: #aaa;
}

.modal-textarea:focus {
    border-color: #B71C1C;
    box-shadow: 0 0 0 2px rgba(183, 28, 28, 0.15);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.btn-modal-cancel {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-modal-cancel:hover {
    background: #f3f4f6;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-modal-reject {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: #B71C1C;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-modal-reject:hover {
    background: #8b1515;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-modal-reject:disabled {
    background: #e5e7eb;
    color: #888;
    cursor: not-allowed;
}

/* ===== Skeleton loading ===== */
.expo-skeleton {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.skeleton-order-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.skeleton-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.skeleton-row:last-child {
    margin-bottom: 0;
}

.skeleton-block {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-badge { width: 80px; height: 28px; border-radius: 20px; }
.skeleton-text-lg { width: 200px; height: 18px; flex: 1; }
.skeleton-text-sm { width: 140px; height: 14px; }

/* Responsive */
@media (max-width: 640px) {

    .expo-controls {
        padding: 0.75rem;
    }

    .expo-order-list {
        padding: 0 0.75rem 0.75rem;
    }

    .order-summary-row {
        padding: 0.875rem 1rem;
    }

    .order-detail {
        padding: 0.875rem 1rem;
    }

    .status-filter-select {
        width: 100%;
    }
}
