/* assets/css/allpackageissued.css */

.allpkg-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ============================================
   HEADER
   ============================================ */
.allpkg-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.allpkg-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.75rem;
    color: #1a1a1a;
    margin: 0 0 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.allpkg-title i { color: #f7941e; }

.allpkg-subtitle {
    color: #6b6b66;
    font-size: 0.9rem;
    margin: 0;
}

.allpkg-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   STATS CARDS
   ============================================ */
.allpkg-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.allpkg-stat-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.allpkg-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.allpkg-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.allpkg-stat-icon--total { background: #fff3e1; color: #c9720f; }
.allpkg-stat-icon--paid { background: #e8f4fd; color: #2980b9; }
.allpkg-stat-icon--complimentary { background: #e5f3e8; color: #2e7d46; }
.allpkg-stat-icon--active { background: #f3e8fd; color: #8e44ad; }
.allpkg-stat-icon--redemptions { background: #fbeae7; color: #c0392b; }

.allpkg-stat-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.allpkg-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b6b66;
}

.allpkg-stat-value {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    color: #1a1a1a;
    line-height: 1.1;
    margin: 0.15rem 0;
}

.allpkg-stat-sub {
    font-size: 0.75rem;
    color: #2e7d46;
    font-weight: 700;
}

/* ============================================
   FILTERS CARD
   ============================================ */
.allpkg-filters-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.allpkg-filters-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.allpkg-filter-search {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.allpkg-filter-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #b3b0a8;
    pointer-events: none;
    transition: color 0.2s ease;
}

.allpkg-filter-search:focus-within i { color: #f7941e; }

.allpkg-filter-search input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    border: 1.5px solid #e5e5e5;
    border-radius: 10px;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s ease;
    background: white;
}

.allpkg-filter-search input:focus {
    border-color: #f7941e;
    box-shadow: 0 0 0 3px rgba(247, 148, 30, 0.12);
}

.allpkg-select {
    padding: 0.65rem 2.2rem 0.65rem 1rem;
    border: 1.5px solid #e5e5e5;
    border-radius: 10px;
    font-size: 0.875rem;
    outline: none;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%236b6b66' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    max-width: 200px;
}

.allpkg-select:focus {
    border-color: #f7941e;
    box-shadow: 0 0 0 3px rgba(247, 148, 30, 0.12);
}

.allpkg-select--sm {
    padding: 0.5rem 1.75rem 0.5rem 0.85rem;
    font-size: 0.8rem;
}

.allpkg-filter-date-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.allpkg-filter-date-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b6b66;
    white-space: nowrap;
}

.allpkg-date-input {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #e5e5e5;
    border-radius: 10px;
    font-size: 0.85rem;
    outline: none;
    background: white;
    transition: all 0.2s ease;
}

.allpkg-date-input:focus {
    border-color: #f7941e;
    box-shadow: 0 0 0 3px rgba(247, 148, 30, 0.12);
}

.allpkg-quick-filters {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
}

.allpkg-quick-btn {
    padding: 0.5rem 0.85rem;
    border: 1.5px solid #e5e5e5;
    border-radius: 50px;
    background: white;
    color: #6b6b66;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.allpkg-quick-btn:hover,
.allpkg-quick-btn.active {
    border-color: #f7941e;
    background: #fff3e1;
    color: #c9720f;
}

/* ============================================
   RESULTS BAR
   ============================================ */
.allpkg-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.allpkg-results-info {
    font-size: 0.875rem;
    color: #6b6b66;
}

.allpkg-results-info strong {
    color: #c9720f;
    font-weight: 700;
}

.allpkg-results-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ============================================
   DATA TABLE
   ============================================ */
.allpkg-table-wrap {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    min-height: 300px;
}

.allpkg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.allpkg-table thead {
    background: #fafaf9;
    border-bottom: 2px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 10;
}

.allpkg-table th {
    padding: 0.85rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b6b66;
    text-align: left;
    white-space: nowrap;
}

.allpkg-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #f1f0ee;
    vertical-align: middle;
}

.allpkg-table tbody tr {
    transition: background 0.15s ease;
}

.allpkg-table tbody tr:hover {
    background: #fff8f0;
}

.allpkg-table tbody tr:last-child td {
    border-bottom: none;
}

.allpkg-th-num { width: 50px; }
.allpkg-th-center { text-align: center; }
.allpkg-table td.allpkg-td-center { text-align: center; }
.allpkg-th-actions { text-align: right; }

/* Cell styles */
.allpkg-purchase-id {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.82rem;
    color: #1a1a1a;
}

.allpkg-customer-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 180px;
}

.allpkg-customer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f7941e, #ff8c00);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.allpkg-customer-info strong {
    display: block;
    color: #1a1a1a;
    font-size: 0.87rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.allpkg-customer-info small {
    color: #b3b0a8;
    font-size: 0.72rem;
}

.allpkg-package-cell {
    font-weight: 600;
    color: #1a1a1a;
}

.allpkg-package-cell small {
    display: block;
    color: #6b6b66;
    font-weight: 400;
    font-size: 0.75rem;
}

/* Type badges */
.allpkg-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.allpkg-type-badge--paid {
    background: #e8f4fd;
    color: #2980b9;
    border: 1px solid #b3d9f0;
}

.allpkg-type-badge--complimentary {
    background: #e5f3e8;
    color: #2e7d46;
    border: 1px solid #b3d9c0;
}

.allpkg-amount {
    font-weight: 700;
    color: #1a1a1a;
}

.allpkg-amount--free {
    color: #2e7d46;
}

/* Coupon counts */
.allpkg-coupon-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    background: #fafaf9;
    font-weight: 700;
    color: #1a1a1a;
}

.allpkg-coupon-count--redeemed {
    background: #e5f3e8;
    color: #2e7d46;
}

.allpkg-coupon-count--remaining {
    background: #fff3e1;
    color: #c9720f;
}

/* Validity */
.allpkg-validity {
    font-size: 0.78rem;
    color: #6b6b66;
    white-space: nowrap;
}

.allpkg-validity.expired {
    color: #c0392b;
    text-decoration: line-through;
}

/* Status badges */
.allpkg-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.allpkg-status-badge--active { background: #e5f3e8; color: #2e7d46; }
.allpkg-status-badge--expired { background: #fbeae7; color: #c0392b; }
.allpkg-status-badge--cancelled { background: #f1f0ee; color: #6b6b66; }

/* Issued by */
.allpkg-issued-by {
    font-size: 0.8rem;
    color: #33322e;
    font-weight: 500;
}

/* Issued at */
.allpkg-issued-at {
    font-size: 0.78rem;
    color: #6b6b66;
    white-space: nowrap;
}

/* Actions */
.allpkg-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.allpkg-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid #e5e5e5;
    background: white;
    color: #6b6b66;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.allpkg-action-btn:hover {
    border-color: #f7941e;
    background: #fff3e1;
    color: #c9720f;
    transform: translateY(-2px);
}

.allpkg-action-btn--view:hover {
    border-color: #2980b9;
    background: #e8f4fd;
    color: #2980b9;
}

.allpkg-action-btn--cancel:hover {
    border-color: #c0392b;
    background: #fbeae7;
    color: #c0392b;
}

.allpkg-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.allpkg-loading,
.allpkg-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    color: #6b6b66;
    gap: 1rem;
    padding: 2rem;
    z-index: 5;
}

.allpkg-empty i {
    font-size: 3.5rem;
    color: #d8d6d1;
}

.allpkg-empty h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.allpkg-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* ============================================
   PAGINATION
   ============================================ */
.allpkg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.allpkg-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #e5e5e5;
    border-radius: 10px;
    background: white;
    color: #33322e;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.allpkg-page-btn:hover:not(:disabled):not(.active) {
    border-color: #f7941e;
    background: #fff3e1;
    color: #c9720f;
}

.allpkg-page-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #f7941e;
}

.allpkg-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ============================================
   BUTTONS
   ============================================ */
.allpkg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.25rem;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1.5px solid transparent;
    text-decoration: none;
    white-space: nowrap;
}

.allpkg-btn--primary {
    background: #f7941e;
    color: #1a1a1a;
    border-color: #f7941e;
}

.allpkg-btn--primary:hover {
    background: #c9720f;
    border-color: #c9720f;
    color: white;
    transform: translateY(-1px);
}

.allpkg-btn--ghost {
    background: transparent;
    color: #33322e;
    border-color: #e5e5e5;
}

.allpkg-btn--ghost:hover {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: #f7941e;
}

.allpkg-btn--danger {
    background: #c0392b;
    color: white;
    border-color: #c0392b;
}

.allpkg-btn--danger:hover {
    background: #a93226;
    border-color: #a93226;
    transform: translateY(-1px);
}

.allpkg-btn--sm {
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
}

/* ============================================
   MODAL STYLES
   ============================================ */
.allpkg-modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}

.allpkg-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff3e1, #ffe2b8);
    border-bottom: 1px dashed #f7941e;
}

.allpkg-modal-header--danger {
    background: linear-gradient(135deg, #fbeae7, #f8d7da);
    border-bottom-color: #c0392b;
}

.allpkg-modal-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #f7941e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.allpkg-modal-icon--danger {
    background: #c0392b;
}

.allpkg-modal-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #1a1a1a;
    margin: 0 0 0.15rem;
}

.allpkg-modal-subtitle {
    font-size: 0.85rem;
    color: #6b6b66;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.allpkg-modal-header .btn-close {
    margin-left: auto;
}

.allpkg-modal-body {
    padding: 1.5rem;
}

.allpkg-detail-section {
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px dashed #e5e5e5;
}

.allpkg-detail-section:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.allpkg-detail-section h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a1a;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.allpkg-detail-section h4 i {
    color: #f7941e;
}

.allpkg-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.allpkg-detail-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b6b66;
    margin-bottom: 0.25rem;
}

.allpkg-detail-field span {
    font-size: 0.9rem;
    color: #1a1a1a;
    font-weight: 600;
}

/* Coupons list in modal */
.allpkg-coupons-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.allpkg-coupon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #fafaf9;
    border-radius: 10px;
    font-size: 0.85rem;
}

.allpkg-coupon-row-title {
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
}

.allpkg-coupon-row-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.allpkg-coupon-row-progress .progress {
    width: 80px;
    height: 6px;
    background: #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
}

.allpkg-coupon-row-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f7941e, #ff8c00);
    border-radius: 10px;
}

.allpkg-coupon-row-progress span {
    font-weight: 700;
    color: #c9720f;
    min-width: 50px;
    text-align: right;
}

.allpkg-detail-notes {
    padding: 0.85rem 1rem;
    background: #fafaf9;
    border-radius: 10px;
    color: #33322e;
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

.allpkg-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: #fafaf9;
    border-top: 1px solid #e5e5e5;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.allpkg-modal-footer-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #6b6b66;
}

.allpkg-modal-footer-info i {
    color: #f7941e;
}

.allpkg-modal-footer-separator {
    margin: 0 0.35rem;
    color: #d8d6d1;
}

.allpkg-cancel-warning {
    color: #33322e;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1199px) {
    .allpkg-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .allpkg-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .allpkg-table-wrap {
        overflow-x: auto;
    }

    .allpkg-table {
        min-width: 1200px;
    }
}

@media (max-width: 767px) {
    .allpkg-stats-grid {
        grid-template-columns: 1fr;
    }

    .allpkg-filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .allpkg-quick-filters {
        margin-left: 0;
        flex-wrap: wrap;
    }

    .allpkg-header-actions {
        width: 100%;
    }

    .allpkg-header-actions .allpkg-btn {
        flex: 1;
        justify-content: center;
    }

    .allpkg-results-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .allpkg-detail-grid {
        grid-template-columns: 1fr;
    }
}