/* WhatsApp webhook queue page. Keep the queue readable while reusing the
   platform's shared table component and WhatsApp colour language. */
.whatsapp-webhook-queue-page,
#whatsappWebhookQueueFilterModal,
#whatsappWebhookQueueDetailModal {
    --wa-queue-ink: #173b36;
    --wa-queue-muted: #6b7f7a;
    --wa-queue-primary: var(--primary, #128c7e);
    --wa-queue-primary-dark: var(--primary-dark, #075e54);
    --wa-queue-secondary: var(--secondary, #25d366);
    --wa-queue-soft: #effaf6;
    --wa-queue-line: #dcebe7;
    width: 100%;
    padding: .5rem 0 2rem;
    color: var(--wa-queue-ink);
}

.whatsapp-webhook-queue-page .shared-table-v2 > .shadow-sm {
    overflow: hidden;
    border: 1px solid var(--wa-queue-line) !important;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 59, 54, .05) !important;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-bar {
    padding: .9rem 1rem .75rem;
    border-bottom: 1px solid var(--wa-queue-line);
    border-radius: 15px 15px 0 0 !important;
    background: linear-gradient(135deg, #f7fcfa 0%, #edf8f4 100%) !important;
    color: var(--wa-queue-ink) !important;
}

.whatsapp-webhook-queue-page .whatsapp-queue-heading h2 {
    margin: .15rem 0 .25rem;
    color: var(--wa-queue-ink);
    font-size: clamp(1.25rem, 2.1vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -.025em;
}

.whatsapp-webhook-queue-page .whatsapp-queue-heading p {
    margin: 0;
    color: var(--wa-queue-muted);
    font-size: .82rem;
    line-height: 1.4;
}

.whatsapp-webhook-queue-page .whatsapp-queue-eyebrow {
    color: var(--wa-queue-primary-dark);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.whatsapp-webhook-queue-page .whatsapp-queue-eyebrow i {
    margin-right: .3rem;
    color: var(--wa-queue-secondary);
}

.whatsapp-webhook-queue-page .whatsapp-queue-count {
    display: inline-flex;
    min-width: 1.9rem;
    height: 1.45rem;
    align-items: center;
    justify-content: center;
    padding: .15rem .55rem;
    border-radius: 999px;
    color: var(--wa-queue-primary-dark);
    background: #d9f4e9;
    font-size: .78rem;
    vertical-align: middle;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-search {
    min-width: min(340px, 40vw);
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-search-input,
.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-per-page-select {
    min-height: 36px;
    border: 1px solid var(--wa-queue-line);
    border-radius: 10px;
    color: var(--wa-queue-ink);
    background: #fff;
    box-shadow: none;
    font-size: .78rem;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-search-input:focus,
.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-per-page-select:focus {
    border-color: var(--wa-queue-primary);
    box-shadow: 0 0 0 3px rgba(18, 140, 126, .12);
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-row2 .btn {
    min-height: 34px;
    border-radius: 8px;
    font-size: .75rem;
    font-weight: 700;
    padding: .4rem .65rem;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-row2 .btn-success {
    border-color: var(--wa-queue-secondary);
    color: #073b32;
    background: var(--wa-queue-secondary);
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-row2 .btn-success:hover,
.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-row2 .btn-success:focus {
    border-color: var(--wa-queue-primary);
    color: #fff;
    background: var(--wa-queue-primary);
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-row2 .btn-dark {
    border-color: var(--wa-queue-primary-dark);
    background: var(--wa-queue-primary-dark);
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-row2 .btn-secondary {
    border-color: #d9eee7;
    color: var(--wa-queue-primary-dark);
    background: var(--wa-queue-soft);
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body {
    padding: 0;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table {
    min-width: 950px;
    margin: 0;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--wa-queue-ink);
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table thead th {
    padding: .7rem .8rem;
    border: 0;
    border-bottom: 1px solid var(--wa-queue-line);
    background: var(--wa-queue-soft);
    color: var(--wa-queue-muted);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody td {
    padding: .78rem .8rem;
    border: 0;
    border-bottom: 1px solid #e6f0ed;
    color: var(--wa-queue-ink);
    font-size: .8rem;
    line-height: 1.4;
    vertical-align: middle;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody td small {
    font-size: .76rem;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody tr:nth-child(even) > * { background: #fbfdfc; }
.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody tr:hover > * { background: #f0faf6; }
.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody tr:last-child td { border-bottom: 0; }

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody td:first-child,
.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody td:nth-child(3) {
    color: var(--wa-queue-primary-dark);
    font-weight: 750;
    white-space: nowrap;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody td:nth-child(2),
.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody td:nth-child(4) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .75rem;
}

.whatsapp-webhook-queue-page .whatsapp-queue-action-cell {
    width: 1%;
    min-width: 112px;
    white-space: nowrap;
    text-align: right;
}

.whatsapp-webhook-queue-page .whatsapp-queue-view-button {
    border: 1px solid var(--wa-queue-line);
    border-radius: 7px;
    color: var(--wa-queue-primary-dark);
    background: var(--wa-queue-soft);
    font-size: .72rem;
    font-weight: 700;
}

.whatsapp-webhook-queue-page .whatsapp-queue-view-button:hover,
.whatsapp-webhook-queue-page .whatsapp-queue-view-button:focus {
    border-color: var(--wa-queue-primary);
    color: #fff;
    background: var(--wa-queue-primary);
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body > div[id*="pagination"] {
    margin-top: 0 !important;
    padding: .75rem 1rem;
    border-top: 1px solid var(--wa-queue-line);
    background: #fbfdfc;
    color: var(--wa-queue-muted);
    font-size: .8rem;
}

.whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body > div[id*="pagination"] .page-link {
    color: var(--wa-queue-primary-dark);
    font-size: .8rem;
}

#whatsappWebhookQueueFilterModal .modal-content {
    border: 1px solid var(--wa-queue-line);
    border-radius: 14px;
}

#whatsappWebhookQueueFilterModal .modal-header {
    border-bottom-color: var(--wa-queue-line);
    background: var(--wa-queue-soft);
}

#whatsappWebhookQueueFilterModal .modal-title,
#whatsappWebhookQueueFilterModal .form-label {
    color: var(--wa-queue-ink);
}

#whatsappWebhookQueueFilterModal .form-label {
    font-size: .9rem;
    font-weight: 700;
}

#whatsappWebhookQueueFilterModal .form-control,
#whatsappWebhookQueueFilterModal .form-select {
    min-height: 42px;
    border-color: var(--wa-queue-line);
    color: var(--wa-queue-ink);
    font-size: .92rem;
}

#whatsappWebhookQueueDetailModal .modal-content {
    border: 1px solid var(--wa-queue-line);
    border-radius: 14px;
}

#whatsappWebhookQueueDetailModal .modal-header {
    border-bottom-color: var(--wa-queue-line);
    background: var(--wa-queue-soft);
}

#whatsappWebhookQueueDetailModal .modal-title {
    color: var(--wa-queue-ink);
}

#whatsappWebhookQueueDetailModal .modal-body {
    color: var(--wa-queue-ink);
    font-size: .82rem;
}

.whatsapp-queue-detail-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: 1rem;
}

.whatsapp-queue-detail-meta-item {
    min-width: 0;
    padding: .65rem .75rem;
    border: 1px solid var(--wa-queue-line);
    border-radius: 8px;
    background: #fbfdfc;
}

.whatsapp-queue-detail-meta-item span {
    display: block;
    margin-bottom: .2rem;
    color: var(--wa-queue-muted);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.whatsapp-queue-detail-meta-item strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--wa-queue-ink);
    font-size: .78rem;
    font-weight: 650;
}

.whatsapp-queue-detail-billing {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    padding: .65rem;
    border: 1px solid var(--wa-queue-line);
    border-radius: 10px;
    background: #f8fcfa;
}

.whatsapp-queue-detail-billing > div {
    min-width: 0;
    padding: .55rem .65rem;
    border-radius: 7px;
    background: #fff;
}

.whatsapp-queue-detail-billing span {
    display: block;
    margin-bottom: .2rem;
    color: var(--wa-queue-muted);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.whatsapp-queue-detail-billing strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--wa-queue-ink);
    font-size: .82rem;
}

.whatsapp-queue-detail-section {
    margin-top: .85rem;
}

.whatsapp-queue-detail-section h6 {
    margin: 0 0 .35rem;
    color: var(--wa-queue-primary-dark);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.whatsapp-queue-detail-url {
    display: block;
    padding: .65rem .75rem;
    border: 1px solid var(--wa-queue-line);
    border-radius: 8px;
    color: var(--wa-queue-ink);
    background: #fbfdfc;
    overflow-wrap: anywhere;
    font-size: .78rem;
    font-weight: 500;
}

.whatsapp-queue-detail-section pre {
    max-height: 260px;
    margin: 0;
    padding: .75rem;
    border: 1px solid var(--wa-queue-line);
    border-radius: 8px;
    color: var(--wa-queue-ink);
    background: #f8fcfa;
    font-size: .76rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow: auto;
}

.whatsapp-queue-detail-error {
    margin-bottom: .75rem;
    font-size: .8rem;
}

.whatsapp-queue-detail-error strong {
    display: block;
    margin-bottom: .2rem;
}

@media (max-width: 767px) {
    .whatsapp-webhook-queue-page { padding: .75rem 0 1.5rem; }
    .whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-bar { padding: .8rem; }
    .whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-search { min-width: 0; width: 100%; }
    .whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-header-row2 { overflow-x: auto; padding-bottom: .25rem; }
    .whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table thead th { font-size: .64rem; }
    .whatsapp-webhook-queue-page .whatsapp-platform-table .shared-table-card-body table tbody td { font-size: .78rem; }
    .whatsapp-queue-detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .whatsapp-queue-detail-billing { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
