/**
 * AFOP Admin Dashboard, Orders Table Buttons, Toast Notifications & Courier Modal
 */

/* Header Banner */
.afop-admin-wrap {
    margin-top: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.afop-header-banner {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    padding: 24px 30px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.afop-header-banner h1 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.afop-header-banner p {
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
}

/* Stat Cards */
.afop-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.afop-stat-card {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.afop-stat-card .afop-stat-num {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}

.afop-stat-card.warning .afop-stat-num {
    color: #d97706;
}

.afop-stat-card.danger .afop-stat-num {
    color: #dc2626;
}

.afop-stat-card.success .afop-stat-num {
    color: #16a34a;
}

.afop-stat-card.info .afop-stat-num {
    color: #2563eb;
}

.afop-stat-card .afop-stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Toolbar */
.afop-toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.afop-toolbar-left,
.afop-toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Settings Panels */
.afop-settings-section,
.afop-card-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-top: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.afop-settings-section h3,
.afop-card-panel h3 {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 17px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Inline Block Form */
.afop-inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Orders Table Ordered Products Column */
.afop-order-products-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
    max-width: 260px;
}

.afop-order-product-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.afop-order-product-item:hover {
    background: #f1f5f9;
}

.afop-product-thumb img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    display: block;
}

.afop-product-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    line-height: 1.25;
}

.afop-product-name-link {
    font-weight: 600;
    font-size: 12px;
    color: #2563eb !important;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 180px;
    transition: color 0.15s ease;
}

.afop-product-name-link:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

.afop-product-name {
    font-weight: 600;
    font-size: 12px;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.afop-product-qty-badge {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 2px;
}

/* WooCommerce Orders Table Column Rules */
.post-type-shop_order .wp-list-table td,
.post-type-shop_order .wp-list-table th,
.woocommerce_page_wc-orders .wp-list-table td,
.woocommerce_page_wc-orders .wp-list-table th {
    width: 17ch !important;
    vertical-align: middle !important;
}

.wp-list-table th.column-afop_courier_ratio,
.wp-list-table td.column-afop_courier_ratio {
    width: 165px !important;
    min-width: 150px !important;
    vertical-align: middle !important;
}

.wp-list-table th.column-afop_security_actions,
.wp-list-table td.column-afop_security_actions {
    width: 245px !important;
    min-width: 235px !important;
    vertical-align: middle !important;
}

/* Orders Table Action Buttons Wrap */
.afop-order-actions-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    min-width: 225px;
    max-width: 242px;
    box-sizing: border-box;
}

.afop-actions-row {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

/* Line 1: Customer Identifiers (Phone, Order IP & WhatsApp) */
.afop-phone-pill-link {
    flex: 1.1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    color: #0f172a;
    background: #f1f5f9;
    padding: 2px 5px;
    border-radius: 4px;
    text-decoration: none !important;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap;
    line-height: 18px;
    height: 22px;
    box-sizing: border-box;
}

.afop-phone-pill-link i {
    color: #2563eb;
    font-size: 9.5px;
    flex-shrink: 0;
}

.afop-phone-pill-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afop-phone-pill-link:hover {
    background: #e2e8f0;
    color: #1d4ed8;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.afop-ip-pill-link {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: #334155;
    background: #f8fafc;
    padding: 2px 5px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-weight: 600;
    white-space: nowrap;
    line-height: 18px;
    height: 22px;
    box-sizing: border-box;
    cursor: default;
    transition: all 0.15s ease;
}

.afop-ip-pill-link i {
    color: #0284c7;
    font-size: 9px;
    flex-shrink: 0;
}

.afop-ip-pill-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afop-ip-pill-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.afop-empty-pill {
    color: #94a3b8 !important;
    background: #f8fafc !important;
    border-color: #f1f5f9 !important;
    cursor: default !important;
}

.afop-empty-pill i {
    color: #94a3b8 !important;
}

.afop-wa-pill-link {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #25D366;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 11px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(37, 211, 102, 0.2);
}

.afop-wa-pill-link:hover {
    background: #1eb956;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(37, 211, 102, 0.4);
    color: #ffffff !important;
}

/* Line 2: Order Count & Block Action Buttons */
.afop-customer-orders-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 5px;
    font-size: 9.5px;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    height: 22px;
    line-height: 18px;
    box-sizing: border-box;
}

.afop-customer-orders-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
    border-color: #94a3b8;
}

.afop-customer-orders-btn.has-multiple {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    border-color: #4338ca;
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.25);
}

.afop-customer-orders-btn.has-multiple:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.afop-btn-box {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 2px 4px;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
    box-sizing: border-box;
    height: 22px;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.afop-btn-box .afop-btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.afop-btn-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.afop-btn-box.is-safe {
    background: #f8fafc;
    color: #475569;
    border-color: #cbd5e1;
}

.afop-btn-box.is-safe:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.15);
}

.afop-btn-box.is-blocked {
    background: #fef2f2;
    color: #dc2626;
    border-color: #f87171;
    font-weight: 700;
}

.afop-btn-box.is-blocked:hover {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.15);
}

.afop-btn-box:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Mini Courier Ratio Graph Card (Table Column) */
button.afop-courier-mini-graph,
.afop-courier-mini-graph {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    user-select: none;
    font-family: inherit;
    color: inherit;
    line-height: inherit;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

button.afop-courier-mini-graph:hover,
.afop-courier-mini-graph:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

/* Risk Color Themes for Mini Graph */
.afop-courier-mini-graph.risk-safe {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border-color: #bbf7d0;
}

.afop-courier-mini-graph.risk-safe:hover {
    border-color: #86efac;
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.12);
}

.afop-courier-mini-graph.risk-medium {
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
    border-color: #fed7aa;
}

.afop-courier-mini-graph.risk-medium:hover {
    border-color: #fde68a;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.12);
}

.afop-courier-mini-graph.risk-high {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    border-color: #fecaca;
}

.afop-courier-mini-graph.risk-high:hover {
    border-color: #fca5a5;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.12);
}

.afop-courier-mini-graph.risk-neutral {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-color: #e2e8f0;
}

.afop-courier-mini-graph.risk-neutral:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

/* Circular SVG Gauge */
.afop-mini-chart-ring {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.afop-circular-chart {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.afop-circle-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 3.5;
}

.afop-circle-progress {
    fill: none;
    stroke-width: 3.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.4s ease, stroke 0.3s ease;
}

.risk-safe .afop-circle-progress {
    stroke: #10b981;
}

.risk-medium .afop-circle-progress {
    stroke: #f59e0b;
}

.risk-high .afop-circle-progress {
    stroke: #ef4444;
}

.risk-neutral .afop-circle-progress {
    stroke: #3b82f6;
}

.afop-mini-chart-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8.5px;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
    letter-spacing: -0.4px;
    text-align: center;
}

.afop-mini-chart-percent i {
    font-size: 11px;
    color: #3b82f6;
}

/* Mini Graph Info */
.afop-mini-graph-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    line-height: 1.15;
}

.afop-mini-graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.afop-mini-rate-text {
    font-size: 11px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.afop-mini-risk-tag {
    font-size: 8.5px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.tag-safe {
    background: #dcfce7;
    color: #15803d;
}

.tag-medium {
    background: #fef3c7;
    color: #b45309;
}

.tag-high {
    background: #fee2e2;
    color: #b91c1c;
}

.tag-neutral {
    background: #e0f2fe;
    color: #0369a1;
}

/* Micro Progress Bar */
.afop-mini-bar-track {
    width: 100%;
    height: 3.5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin: 1px 0;
}

.afop-mini-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.fill-safe {
    background: linear-gradient(90deg, #10b981, #059669);
}

.fill-medium {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.fill-high {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.fill-neutral {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.afop-mini-graph-sub {
    font-size: 9.5px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.afop-mini-graph-sub i.fa-check {
    color: #16a34a;
}

.afop-mini-graph-sub i.fa-rotate-left {
    color: #dc2626;
}



.afop-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    background: #f8fafc;
    color: #334155;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-align: left;
    width: 100%;
}

.afop-btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.afop-toggle-block-btn.is-safe {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
}

.afop-toggle-block-btn.is-safe:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.afop-toggle-block-btn.is-blocked {
    background: #fef2f2;
    color: #dc2626;
    border-color: #f87171;
    font-weight: 700;
}

.afop-toggle-block-btn.is-blocked:hover {
    background: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}

.afop-check-courier-btn {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.afop-check-courier-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.afop-btn-whatsapp {
    background: #25D366 !important;
    color: #fff !important;
    border-color: #25D366 !important;
}

/* Badges & Status */
.afop-badge-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.afop-badge-status.status-incomplete {
    background: #fef3c7;
    color: #92400e;
}

.afop-badge-status.status-converted {
    background: #dcfce7;
    color: #166534;
}

.afop-badge-status.status-recovered {
    background: #e0e7ff;
    color: #3730a3;
}

.afop-badge-status.status-blocked {
    background: #fee2e2;
    color: #991b1b;
}

.afop-badge-status.status-unblocked {
    background: #f1f5f9;
    color: #475569;
}

.afop-type-pill {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.afop-type-pill.pill-phone {
    background: #e0f2fe;
    color: #0369a1;
}

.afop-type-pill.pill-ip {
    background: #f3e8ff;
    color: #6b21a8;
}

.afop-phone-tag {
    font-size: 12px;
    color: #0f172a;
    font-weight: 600;
}

/* Toast Notifications */
.afop-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.afop-toast {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: afop-toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s ease;
}

@keyframes afop-toast-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.afop-toast.afop-toast-out {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
}

/* Admin Courier Ratio Modal */
.afop-admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.afop-admin-modal-box {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: afop-modal-pop 0.25s ease-out;
}

@keyframes afop-modal-pop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.afop-admin-modal-header {
    background: #f8fafc;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.afop-modal-header-left h2 {
    font-size: 18px;
    margin: 4px 0 0;
    color: #0f172a;
}

.afop-modal-badge {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.afop-phone-pill {
    display: inline-block;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.afop-admin-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
}

.afop-admin-modal-close:hover {
    color: #0f172a;
}

/* Provider Tabs inside Courier Modal */
.afop-courier-provider-tabs {
    display: flex;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 16px 0;
    gap: 8px;
}

.afop-courier-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.afop-courier-tab-btn:hover {
    color: #0f172a;
}

.afop-courier-tab-btn.active {
    color: #2563eb;
    background: #ffffff;
    border-bottom-color: #2563eb;
    border-radius: 6px 6px 0 0;
}

.afop-admin-modal-body {
    padding: 24px;
    max-height: 65vh;
    overflow-y: auto;
}

.afop-admin-modal-footer {
    background: #f8fafc;
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Ratio Grid inside Modal */
.afop-ratio-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.afop-gauge-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.afop-gauge-wrap {
    margin-bottom: 12px;
}

.afop-gauge-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 8px solid #22c55e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.2);
}

.afop-gauge-circle.risk-medium {
    border-color: #eab308;
    box-shadow: 0 4px 10px rgba(234, 179, 8, 0.2);
}

.afop-gauge-circle.risk-high {
    border-color: #ef4444;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.afop-gauge-percent {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.afop-gauge-sub {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 3px;
}

.afop-risk-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}

.afop-risk-badge.safe {
    background: #dcfce7;
    color: #166534;
}

.afop-risk-badge.medium {
    background: #fef9c3;
    color: #854d0e;
}

.afop-risk-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

.afop-metrics-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.afop-metric-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.afop-metric-item .afop-metric-val {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-bottom: 2px;
}

.afop-metric-item.success .afop-metric-val {
    color: #16a34a;
}

.afop-metric-item.danger .afop-metric-val {
    color: #dc2626;
}

.afop-metric-item.return-rate .afop-metric-val {
    color: #d97706;
}

.afop-metric-item .afop-metric-lbl {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Courier Breakdown Table */
.afop-breakdown-section h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.afop-courier-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.afop-courier-table th,
.afop-courier-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.afop-courier-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}

/* Notice Banner */
.afop-notice-banner {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 16px;
}

/* Spinner Loader */
.afop-loader-wrap {
    text-align: center;
    padding: 40px 20px;
}

.afop-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: afop-spin 0.8s linear infinite;
}

@keyframes afop-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 600px) {
    .afop-ratio-grid {
        grid-template-columns: 1fr;
    }
}

/* SARKAR IT Copyright Footer Card */
.afop-copyright-card {
    margin-top: 30px;
    background: #0f172a;
    color: #cbd5e1;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border: 1px solid #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.afop-copyright-card a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
}

.afop-copyright-card a:hover {
    text-decoration: underline;
}

.afop-copyright-title {
    font-size: 16px;
    color: #f8fafc;
    font-weight: 700;
    margin-bottom: 6px;
}

.afop-copyright-title i {
    color: #38bdf8;
}

.afop-copyright-address {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.afop-copyright-right p {
    margin: 3px 0;
    font-size: 13px;
    color: #94a3b8;
}

.afop-copyright-right p i {
    width: 16px;
    color: #38bdf8;
}

.afop-copyright-text {
    margin-top: 6px !important;
    color: #64748b !important;
}

/* 1.10: Sarkar IT store tools. All dashboard controls stay inside the plugin. */
.afop-admin-wrap { --afop-ink: #163c5b; --afop-blue: #216b9d; --afop-line: #dce6ee; --afop-muted: #62778a; max-width: 1400px; margin: 24px 24px 32px 4px; color: var(--afop-ink); }
.afop-admin-wrap .afop-header-banner { position: relative; overflow: hidden; background: linear-gradient(115deg, #123f65, #19557d); padding: 26px 32px 30px; border: 1px solid #164c74; border-radius: 16px; margin-bottom: 22px; box-shadow: 0 8px 24px #123f6510; }
.afop-admin-wrap .afop-header-banner::after { content: ''; position: absolute; width: 210px; height: 210px; border: 1px solid #ffffff17; border-radius: 50%; right: -60px; top: -90px; pointer-events: none; }
.afop-header-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; font-size: 10px; font-weight: 650; letter-spacing: 1.6px; color: #d7e8f3; }
.afop-version { font-size: 11px; letter-spacing: .3px; border: 1px solid #ffffff30; border-radius: 6px; padding: 3px 9px; color: #ffe1a0; white-space: nowrap; }
.afop-admin-wrap .afop-header-banner h1 { font-size: 26px; line-height: 1.4; font-weight: 650; letter-spacing: -.5px; gap: 12px; padding: 0; }
.afop-admin-wrap .afop-header-banner h1 > i, .afop-header-banner h1 > .dashicons { color: #ffd16a; font-size: 26px; width: 28px; height: 28px; }
.afop-admin-wrap .afop-header-banner p { color: #c8deec; font-size: 13px; line-height: 1.7; max-width: 850px; margin-top: 9px; }
.afop-admin-wrap .nav-tab-wrapper { display: flex; gap: 5px; flex-wrap: wrap; border: 1px solid var(--afop-line); background: #fff; border-radius: 11px; padding: 6px; margin: 0 0 24px; }
.afop-admin-wrap .nav-tab { border: 0; border-radius: 7px; background: transparent; color: #536b7e; padding: 10px 17px; margin: 0; font-size: 12px; font-weight: 600; line-height: 1.6; text-decoration: none; box-shadow: none; }
.afop-admin-wrap .nav-tab:hover { background: #f0f6fa; color: #154b73; }
.afop-admin-wrap .nav-tab-active, .afop-admin-wrap .nav-tab-active:hover { background: #e9f3fa; color: #145c90; }
.afop-admin-wrap .nav-tab > i { margin-right: 5px; }
.afop-admin-wrap .nav-tab > .dashicons { font-size: 16px; width: 18px; height: 20px; vertical-align: middle; margin-right: 6px; }
.afop-admin-wrap .afop-settings-section h3 > .dashicons { color: #287eaf; font-size: 20px; }
.afop-admin-wrap .afop-settings-section, .afop-admin-wrap .afop-card-panel { border-color: var(--afop-line); border-radius: 14px; padding: 28px; margin: 0 0 22px; box-shadow: 0 4px 16px #123f6505; }
.afop-admin-wrap .afop-settings-section h3, .afop-admin-wrap .afop-card-panel h3 { font-size: 17px; font-weight: 650; color: var(--afop-ink); padding-bottom: 18px; border-bottom-color: #e9eff4; margin-bottom: 6px; }
.afop-admin-wrap .afop-settings-section h3 > i { color: #287eaf; }
.afop-admin-wrap .form-table { margin: 6px 0; }
.afop-admin-wrap .form-table th { color: #284b64; font-size: 13px; font-weight: 600; width: 235px; padding: 23px 24px 23px 0; line-height: 1.7; }
.afop-admin-wrap .form-table td { padding: 21px 0; color: #3e596d; font-size: 13px; line-height: 1.7; }
.afop-admin-wrap .form-table tr + tr > th, .afop-admin-wrap .form-table tr + tr > td { border-top: 1px solid #eef3f7; }
.afop-admin-wrap input[type="text"], .afop-admin-wrap input[type="email"], .afop-admin-wrap input[type="password"], .afop-admin-wrap input[type="number"], .afop-admin-wrap select, .afop-admin-wrap textarea { border: 1px solid #cbdbe7; border-radius: 7px; background: #fff; color: #254a64; min-height: 39px; padding: 7px 11px; box-shadow: 0 1px 2px #123f6504; font-size: 13px; }
.afop-admin-wrap input.regular-text { width: min(100%, 440px); }
.afop-admin-wrap textarea { max-width: 760px; width: 100%; line-height: 1.7; padding: 11px 13px; min-height: 84px; }
.afop-admin-wrap select { max-width: 100%; padding-right: 30px; }
.afop-admin-wrap input:focus, .afop-admin-wrap select:focus, .afop-admin-wrap textarea:focus { border-color: #287eaf; outline: 2px solid #287eaf25; outline-offset: 1px; box-shadow: none; }
.afop-admin-wrap .description, .afop-admin-wrap p.description { color: var(--afop-muted); font-size: 12px; line-height: 1.8; max-width: 760px; margin-top: 8px; }
.afop-admin-wrap .form-table input[type="checkbox"] { appearance: none; position: relative; width: 36px; height: 21px; min-width: 36px; border: 1px solid #a8bac9; border-radius: 20px; background: #e1e9ef; box-shadow: none; vertical-align: middle; margin-right: 9px; }
.afop-admin-wrap .form-table input[type="checkbox"]::before { content: ''; display: block; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 1px solid #9eafbc; margin: 2px; float: none; }
.afop-admin-wrap .form-table input[type="checkbox"]:checked { background: #216b9d; border-color: #216b9d; }
.afop-admin-wrap .form-table input[type="checkbox"]:checked::before { content: ''; border-color: #fff; margin-left: 17px; }
.afop-admin-wrap .button { border: 1px solid #cbdbe7; border-radius: 7px; color: #1d557c; background: #fff; box-shadow: 0 1px 2px #123f6504; padding: 4px 14px; min-height: 36px; font-size: 12px; font-weight: 600; line-height: 26px; }
.afop-admin-wrap .button:hover { border-color: #98b8ce; background: #f0f7fb; color: #123f65; }
.afop-admin-wrap .button-primary { color: #fff; background: #216b9d; border-color: #216b9d; padding: 5px 21px; }
.afop-admin-wrap .button-primary:hover { color: #fff; background: #174f77; border-color: #174f77; }
.afop-admin-wrap .button:focus-visible, .afop-admin-wrap .nav-tab:focus-visible { outline: 2px solid #216b9d; outline-offset: 3px; }
.afop-admin-wrap form > .submit { margin: 18px 0 0; padding: 18px 0 0; border-top: 1px solid var(--afop-line); }
.afop-admin-wrap .afop-courier-card { border-color: var(--afop-line) !important; border-radius: 11px !important; box-shadow: none !important; margin-top: 20px; }
.afop-admin-wrap .widefat { border: 1px solid var(--afop-line); border-radius: 10px; border-spacing: 0; box-shadow: none; overflow: hidden; }
.afop-admin-wrap .widefat thead th, .afop-admin-wrap .widefat tfoot th { background: #f3f7fa; color: #496779; font-size: 11px; font-weight: 650; padding: 13px 15px; border-bottom: 1px solid var(--afop-line); }
.afop-admin-wrap .widefat td { padding: 15px; font-size: 12px; vertical-align: middle; color: #33536b; border-bottom: 1px solid #eef3f7; }
.afop-admin-wrap .striped > tbody > :nth-child(odd) { background: #fff; }
.afop-admin-wrap .widefat tbody tr:hover { background: #f7fafc; }
.afop-admin-wrap .afop-stat-card { border-color: var(--afop-line); border-radius: 12px; box-shadow: 0 3px 12px #123f6504; padding: 23px; }
.afop-admin-wrap .afop-stat-card .afop-stat-num { font-size: 30px; font-weight: 650; letter-spacing: -.8px; }
.afop-admin-wrap .afop-toolbar-row { background: #fff; border-color: var(--afop-line); border-radius: 10px; padding: 14px 18px; margin-bottom: 18px; }
.afop-admin-wrap .afop-copyright-card { background: #edf4f9; border-color: var(--afop-line); box-shadow: none; border-radius: 12px; color: #536b7e; margin-top: 28px; }
.afop-admin-wrap .afop-copyright-title { color: #163c5b; font-size: 14px; }
.afop-admin-wrap .afop-copyright-card p { color: #62778a; font-size: 12px; }
.afop-admin-wrap .afop-copyright-card a { color: #216b9d; }
.afop-section-kicker { display: block; font-size: 10px; font-weight: 700; letter-spacing: 1.3px; color: #62778a; margin-bottom: 7px; }
.afop-section-heading { margin-bottom: 10px; }
.afop-section-heading h2 { margin: 0 0 7px; padding: 0; font-size: 19px; line-height: 1.5; font-weight: 650; color: #163c5b; }
.afop-section-heading > p { color: #62778a; font-size: 12px; margin: 0 0 12px; }
.afop-stock-summary { display: grid; grid-template-columns: 1fr 1fr 1fr; background: #fff; border: 1px solid var(--afop-line); border-radius: 12px; margin: 0 0 22px; padding: 22px 4px; }
.afop-stock-summary > div { padding: 0 25px; }
.afop-stock-summary > div + div { border-left: 1px solid var(--afop-line); }
.afop-stock-summary strong { display: block; color: #163c5b; font-size: 26px; font-weight: 650; line-height: 1.5; }
.afop-stock-summary small { color: #62778a; font-size: 12px; font-weight: 400; }
.afop-stock-summary .afop-status-on { color: #177058; }
.afop-stock-summary .afop-status-off { color: #6e7f8c; }
.afop-toggle-label { display: inline-flex; align-items: center; gap: 12px; position: relative; }
.afop-admin-wrap .form-table .afop-toggle-label .afop-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; min-width: 0; margin: 0; }
.afop-toggle-track { display: inline-block; position: relative; flex: 0 0 42px; width: 42px; height: 24px; border-radius: 20px; background: #c9d6df; border: 1px solid #acbdcb; }
.afop-toggle-track::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; box-shadow: 0 1px 3px #123f6520; }
.afop-toggle:checked + .afop-toggle-track { background: #216b9d; border-color: #216b9d; }
.afop-toggle:checked + .afop-toggle-track::before { left: 21px; }
.afop-toggle:focus-visible + .afop-toggle-track { outline: 2px solid #216b9d; outline-offset: 3px; }
.afop-table-scroll { overflow-x: auto; margin: 20px 0; }
.afop-stock-inventory .widefat { min-width: 620px; }
.afop-product-id { display: block; font-size: 11px; color: #7a8c9b; margin-top: 4px; }
.afop-stock-quantity { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; border-radius: 6px; padding: 5px 10px; color: #805112; background: #fff0d0; font-size: 13px; font-weight: 650; }
.afop-stock-quantity.afop-stock-empty { color: #a63737; background: #fff0ee; }
.afop-admin-wrap .widefat td.afop-empty-state { padding: 40px 20px; text-align: center; }
.afop-empty-state > .dashicons { display: block; width: 38px; height: 38px; color: #287eaf; font-size: 32px; margin: 0 auto 12px; }
.afop-empty-state strong { display: block; font-size: 14px; }
.afop-empty-state p { color: #62778a; font-size: 12px; }
.afop-admin-wrap .page-numbers { display: inline-block; padding: 7px 12px; background: #fff; border: 1px solid var(--afop-line); border-radius: 6px; margin: 2px; color: #216b9d; text-decoration: none; font-size: 12px; }
.afop-admin-wrap .page-numbers.current { color: #fff; background: #216b9d; border-color: #216b9d; }
@media (max-width: 900px) { .afop-admin-wrap .form-table th { width: 190px; } .afop-stock-summary small { display: block; } }
@media (max-width: 782px) { .afop-admin-wrap { margin: 18px 10px 24px 0; } .afop-admin-wrap .afop-header-banner { padding: 22px; } .afop-admin-wrap .afop-header-banner h1 { font-size: 22px; } .afop-admin-wrap .afop-settings-section, .afop-admin-wrap .afop-card-panel { padding: 20px; } .afop-admin-wrap .form-table th { width: auto; padding: 18px 0 7px; } .afop-admin-wrap .form-table td { padding: 0 0 18px; } .afop-admin-wrap .form-table tr + tr > td { border-top: 0; } .afop-admin-wrap .nav-tab { padding: 9px 12px; } .afop-stock-summary > div { padding: 0 14px; } .afop-stock-summary strong { font-size: 22px; } }
@media (max-width: 480px) { .afop-stock-summary { grid-template-columns: 1fr; gap: 16px; padding: 20px; } .afop-stock-summary > div { padding: 0; } .afop-stock-summary > div + div { border-left: 0; border-top: 1px solid var(--afop-line); padding-top: 16px; } .afop-stock-summary small { display: inline; } }
