/* ================================================
   APPROVAL PAGE — Full Scoped CSS (ap- prefix)
   Stat cards match MyBookings mb- pattern exactly
   ================================================ */

/* Header */
.ap-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.ap-header-text h1 {
    font-size: 22px;
    font-weight: 700;
    color: #334155;
    margin: 0 0 4px 0;
}

.ap-header-text p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.ap-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ap-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

    .ap-btn-outline:hover {
        background-color: #f8fafc;
        border-color: #94a3b8;
        color: #1e293b;
    }

    .ap-btn-outline svg {
        width: 14px;
        height: 14px;
        flex-shrink: 0;
    }

/* =============================================
   STAT CARDS — mirrors mb-stat-card pattern:
   90deg gradient, border-bottom accent,
   absolutely positioned white icon box (right, centered)
   ============================================= */
.ap-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 0;
}

.ap-stat-card {
    border-radius: 8px;
    padding: 16px;
    position: relative; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    min-height: 90px;
    overflow: hidden;
}

.ap-stat-title {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 8px;
}

.ap-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0;
    line-height: 1;
}

/* Absolutely positioned icon box — same as mb-card-icon */
.ap-stat-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 16px;
    width: 44px;
    height: 44px;
    background-color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

    .ap-stat-icon svg {
        width: 20px;
        height: 20px;
        fill: none;
        stroke-width: 1.5;
    }

/* 1. Total Applications — Purple (mirrors mb-card-total) */
.ap-stat-purple {
    background: linear-gradient(90deg, #FAFAFF 0%, #E6E4FF 100%);
    border-left: 3px solid #4F46E5;
}

    .ap-stat-purple .ap-stat-icon svg {
        stroke: #4F46E5;
    }

/* 2. Pending Validation — Orange */
.ap-stat-orange {
    background: linear-gradient(90deg, #FFFAF5 0%, #FFE8CC 100%);
    border-left: 3px solid #EA580C;
}

    .ap-stat-orange .ap-stat-icon svg {
        stroke: #EA580C;
    }

/* 3. Validated by MO — Cyan (mirrors mb-card-upcoming) */
.ap-stat-cyan {
    background: linear-gradient(90deg, #F4FFFF 0%, #D6FBF9 100%);
    border-left: 3px solid #0D9488;
}

    .ap-stat-cyan .ap-stat-icon svg {
        stroke: #0D9488;
    }

/* 4. Rejected — Red (mirrors mb-card-cancelled) */
.ap-stat-red {
    background: linear-gradient(90deg, #FFF5F5 0%, #FEE0E0 100%);
    border-left: 3px solid #DC2626;
}

    .ap-stat-red .ap-stat-icon svg {
        stroke: #DC2626;
    }

/* 5. Completed — Green (mirrors mb-card-completed) */
.ap-stat-green {
    background: linear-gradient(90deg, #F4FDF6 0%, #D3FCE3 100%);
    border-left: 3px solid #16A34A;
}

    .ap-stat-green .ap-stat-icon svg {
        stroke: #16A34A;
    }

/* =============================================
   TABS — underline style
   ============================================= */
.ap-tabs-row {
    display: flex;
    align-items: center;
    background-color: #F1F5F9;
    padding: 6px;
    border-radius: 10px;
    gap: 4px;
    margin-top: 20px;
    margin-bottom: 20px;
    width: fit-content;
}

.ap-tab {
    padding: 9px 22px;
    font-size: 13px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

    .ap-tab:hover {
        color: #475569;
    }

    .ap-tab.active {
        background-color: #ffffff;
        color: #0f172a;
        font-weight: 600;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    }
/* =============================================
   TABLE CARD
   ============================================= */
.ap-table-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ap-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 16px;
    flex-wrap: wrap;
}

    .ap-table-header h3 {
        font-size: 15px;
        font-weight: 700;
        color: #1e293b;
        margin: 0;
    }

.ap-table-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ap-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

    .ap-search-wrap svg {
        position: absolute;
        left: 11px;
        width: 14px;
        height: 14px;
        color: #94a3b8;
        pointer-events: none;
    }

    .ap-search-wrap input {
        width: 220px;
        height: 36px;
        padding: 0 12px 0 32px;
        font-size: 13px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background-color: #F3F4F6;
        color: #334155;
        outline: none;
        transition: border-color 0.2s;
    }

        .ap-search-wrap input::placeholder {
            color: #94a3b8;
        }

        .ap-search-wrap input:focus {
            border-color: #94a3b8;
            background-color: #ffffff;
        }

.ap-select {
    height: 36px;
    padding: 0 30px 0 12px;
    font-size: 13px;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 13px;
    min-width: 130px;
}

.ap-select-sm {
    height: 32px;
    padding: 0 26px 0 10px;
    font-size: 13px;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background-color: #ffffff;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 12px;
    min-width: 68px;
}

/* Table */
.ap-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
}

.ap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .ap-table thead th {
        text-align: left;
        padding: 12px 16px;
        font-size: 12px;
        font-weight: 600;
        color: #64748b;
        background-color: #F2F3F3;
        border-bottom: 1px solid #e2e8f0;
        white-space: nowrap;
    }

    .ap-table tbody td {
        padding: 15px 16px;
        color: #334155;
        font-size: 13px;
        border-bottom: 1px solid #f1f5f9;
        white-space: nowrap;
    }

    .ap-table tbody tr:last-child td {
        border-bottom: none;
    }

    .ap-table tbody tr:hover td {
        background-color: #fafbfc;
    }

.ap-dealer-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ap-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #dbeafe;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ap-td-teal {
    color: #0d9488 !important;
    font-weight: 500;
}

.ap-status {
    display: inline-block;
    padding: 5px 13px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.ap-status-pending {
    background-color: #ffedd5;
    color: #c2410c;
}

.ap-status-validated {
    background-color: #ccfbf1;
    color: #0f766e;
}

.ap-status-rejected {
    background-color: #fee2e2;
    color: #b91c1c;
}

.ap-status-completed {
    background-color: #dcfce7;
    color: #15803d;
}

.ap-row-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ap-icon-btn {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: opacity 0.15s, transform 0.15s;
}

    .ap-icon-btn:hover {
        opacity: 0.7;
        transform: scale(1.1);
    }

    .ap-icon-btn svg {
        width: 17px;
        height: 17px;
    }

.ap-icon-view svg {
    stroke: #3b82f6;
}

.ap-icon-edit svg {
    stroke: #ec4899;
}

/* Pagination */
.ap-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 12px;
}

.ap-page-size {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #64748b;
}

.ap-page-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ap-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #475569;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .ap-page-btn:hover:not(.active) {
        background-color: #f8fafc;
        border-color: #94a3b8;
    }

    .ap-page-btn.active {
        background-color: #1e293b;
        color: #ffffff;
        border-color: #1e293b;
        font-weight: 600;
    }

.ap-page-arrow svg {
    width: 13px;
    height: 13px;
}

.ap-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    font-size: 14px;
    color: #94a3b8;
    letter-spacing: 1px;
    border: none;
    background: transparent;
    cursor: default;
}

/* ================================================
   RESPONSIVE BREAKPOINTS
   ================================================ */

/* Large laptop / small desktop — 4 stats per row */
@media (max-width: 1400px) {
    .ap-stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet landscape — 3 stats per row */
@media (max-width: 1100px) {
    .ap-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ap-search-wrap input {
        width: 180px;
    }
}

/* Tablet portrait — 2 stats, controls stack */
@media (max-width: 860px) {
    .ap-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ap-table-header {
        flex-direction: column;
        align-items: stretch;
    }

    .ap-table-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .ap-search-wrap {
        flex: 1;
        min-width: 200px;
    }

        .ap-search-wrap input {
            width: 100%;
        }

    .ap-select {
        flex: 1;
        min-width: 130px;
    }

    /* Tabs become horizontally scrollable to prevent overflow */
    .ap-tabs-row {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

        .ap-tabs-row::-webkit-scrollbar {
            display: none;
        }

    .ap-tab {
        padding: 8px 16px;
        flex-shrink: 0;
    }
}

/* Mobile — single column, stacked layout */
@media (max-width: 600px) {
    .ap-header-row {
        flex-direction: column;
        gap: 14px;
        align-items: stretch;
    }

    .ap-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .ap-btn-outline {
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }

    .ap-stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ap-stat-card {
        padding: 14px 16px;
        min-height: 80px;
    }

    .ap-stat-value {
        font-size: 22px;
    }

    .ap-stat-icon {
        width: 40px;
        height: 40px;
        right: 14px;
    }

        .ap-stat-icon svg {
            width: 18px;
            height: 18px;
        }

    .ap-table-card {
        padding: 16px;
    }

    .ap-table-header h3 {
        font-size: 14px;
    }

    /* Table — let it scroll horizontally on mobile */
    .ap-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ap-table {
        min-width: 800px;
    }

        .ap-table thead th,
        .ap-table tbody td {
            padding: 12px 14px;
        }

    /* Pagination stacks and centers */
    .ap-pagination {
        flex-direction: column;
        align-items: center;
        gap: 14px;
    }

    .ap-page-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    .ap-header-text h1 {
        font-size: 19px;
    }

    .ap-header-text p {
        font-size: 12px;
    }

    .ap-btn-outline {
        padding: 6px 10px;
        font-size: 12px;
    }

        .ap-btn-outline svg {
            width: 12px;
            height: 12px;
        }

    .ap-tab {
        padding: 8px 14px;
        font-size: 12px;
    }

    .ap-stat-title {
        font-size: 12px;
    }

    .ap-stat-value {
        font-size: 20px;
    }

    /* Hide some pagination numbers to save space */
    .ap-page-nav .ap-page-btn:nth-child(6),
    .ap-page-nav .ap-page-btn:nth-child(7) {
        display: none;
    }
}
/* Benefit Status Pills (Used in Completed Tab) */
.ap-benefit-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ap-benefit-purple {
    background-color: #F3E8FF;
    color: #7E22CE;
}

.ap-benefit-blue {
    background-color: #DBEAFE;
    color: #1D4ED8;
}

.ap-benefit-green {
    background-color: #DCFCE7;
    color: #15803D;
}

