/* === File: ./assets/css/admin-style.css === */

/* ─── Reset for Plugin Admin Area ──────────────────────────────────────────── */
.wrap.egpda-lite-container .postbox,
.wrap.egpda-lite-container .metabox-holder,
.wrap.egpda-lite-container .notice:not(.is-dismissible):not(.inline) {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* ─── Font ──────────────────────────────────────────────────────────────────── */
/* Jost is enqueued via PHP (Google Fonts, scoped to plugin pages only) */
.egpda-lite-container,
.egpda-lite-container button,
.egpda-lite-container input,
.egpda-lite-container select,
.egpda-lite-container textarea,
.egpda-lite-container .dashboard-box,
.daterangepicker {
    font-family: 'Jost', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* ─── Main Container ────────────────────────────────────────────────────────── */
.egpda-lite-container {
    margin: 20px auto;
    padding: 0 20px;
    box-sizing: border-box;
    width: auto;
}

/* ─── Grid Layout ───────────────────────────────────────────────────────────── */
.egpda-grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    box-sizing: border-box;
    margin-top: 20px;
    align-items: stretch;
}

/* ─── Card Base ─────────────────────────────────────────────────────────────── */
.egpda-lite-container .dashboard-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07), 0 4px 12px rgba(0, 0, 0, 0.04);
    padding: 22px;
    color: #3c434a;
    font-size: 14px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 150px;
    height: 100%;
    transition: box-shadow 0.2s ease;
}
.egpda-lite-container .dashboard-box:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09), 0 8px 20px rgba(0, 0, 0, 0.06);
}

/* Card title */
.egpda-lite-container .dashboard-box h5 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1d2327;
    line-height: 1.3;
    flex-shrink: 0;
}

/* Large number */
.egpda-lite-container .dashboard-box .h2 {
    font-size: 2.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
    color: #1d2327;
    flex-shrink: 0;
}

/* Card footer */
.egpda-lite-container .dashboard-box .egpda-card-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f1;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    font-size: 11px;
    color: #646970;
    flex-shrink: 0;
}
.egpda-lite-container .dashboard-box .egpda-card-footer a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}
.egpda-lite-container .dashboard-box .egpda-card-footer a:hover { color: #00a0d2; text-decoration: underline; }

/* Focus visible — keyboard navigation */
.egpda-lite-container a:focus-visible,
.egpda-lite-container button:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    border-radius: 3px;
}

/* ─── Section Headers ───────────────────────────────────────────────────────── */
.egpda-section-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid #f0f0f1;
}
.egpda-section-header h3 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a7aaaf;
}
.egpda-section-period {
    font-size: 0.75rem;
    color: #b8bcc2;
    font-weight: 400;
}

/* ─── Metric Cards ──────────────────────────────────────────────────────────── */
.egpda-lite-container .dashboard-box.egpda-metric-card {
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    justify-content: flex-start;
    min-height: 185px;
    height: auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Fade-in on load */
    animation: egpda-card-in 0.35s ease both;
}
.egpda-lite-container .dashboard-box.egpda-metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.egpda-lite-container .dashboard-box.egpda-metric-card h5 {
    opacity: 0.85;
    font-weight: 500;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
}
.egpda-lite-container .dashboard-box.egpda-metric-card .h2 {
    font-size: 2.0rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    margin-bottom: 8px;
    line-height: 1.2;
    flex-grow: 0;
}
.egpda-lite-container .dashboard-box.egpda-metric-card .egpda-metric-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}
.egpda-lite-container .dashboard-box.egpda-metric-card .egpda-card-footer {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.75);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 0 0;
}
.egpda-lite-container .dashboard-box.egpda-metric-card .egpda-card-footer a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: color 0.15s ease;
}
.egpda-lite-container .dashboard-box.egpda-metric-card .egpda-card-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Trend badge */
.egpda-metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.88em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    text-decoration: none;
    transition: background-color 0.2s ease;
    margin-top: 10px;
    width: fit-content;
}
.egpda-metric-trend:hover { background-color: rgba(255, 255, 255, 0.25); color: #ffffff !important; text-decoration: none; }
.egpda-metric-trend .dashicons { font-size: 14px; width: auto; height: auto; line-height: inherit; }
.egpda-metric-trend .egpda-trend-label { opacity: 0.8; margin-left: 3px; }
.egpda-metric-trend.increase  { background-color: rgba(44, 168, 102, 0.9); }
.egpda-metric-trend.increase:hover { background-color: rgba(39, 153, 94, 1); }
.egpda-metric-trend.decrease  { background-color: rgba(214, 54, 56, 0.9); }
.egpda-metric-trend.decrease:hover { background-color: rgba(194, 48, 50, 1); }

/* Background watermark icon */
.egpda-metric-watermark {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 56px !important;
    width: 56px !important;
    height: 56px !important;
    opacity: 0.12;
    color: #ffffff;
    pointer-events: none;
    line-height: 1 !important;
}

/* Trend context label */
.egpda-trend-context {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
    display: block;
    letter-spacing: 0.02em;
}

/* Number reveal animation */
.egpda-animate-value {
    animation: egpda-value-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes egpda-value-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Skeleton Loading ───────────────────────────────────────────────────────── */
@keyframes egpda-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}
.egpda-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.1) 75%);
    background-size: 600px 100%;
    animation: egpda-shimmer 1.4s infinite linear;
    border-radius: 4px;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
}
.egpda-skeleton * { visibility: hidden !important; }

/* Applied to the grid container during refresh — dims chart cards slightly */
.egpda-grid-container.is-refreshing .egpda-chart-card {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.egpda-grid-container.is-refreshing .egpda-metric-card .h2 {
    position: relative;
    overflow: hidden;
}
.egpda-grid-container.is-refreshing .egpda-metric-card .h2::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.3) 50%, transparent 75%);
    background-size: 300px 100%;
    animation: egpda-shimmer 1.2s infinite linear;
    border-radius: 3px;
}

/* ─── Live Data Dot ──────────────────────────────────────────────────────────── */
#egpda-last-updated::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: #2ca866;
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 0 0 rgba(44, 168, 102, 0.5);
    animation: egpda-live-pulse 2.5s infinite ease-out;
    vertical-align: middle;
    flex-shrink: 0;
    /* Override the dashicon pseudo-element from before */
    font-family: inherit;
    font-size: inherit;
    opacity: 1;
}
@keyframes egpda-live-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(44, 168, 102, 0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(44, 168, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(44, 168, 102, 0); }
}

/* ─── Chart Heading Row ──────────────────────────────────────────────────────── */
.egpda-chart-heading-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    flex-shrink: 0;
}
.egpda-chart-heading-row h5 {
    margin-bottom: 0 !important;
}
.egpda-chart-period-label {
    font-size: 11px;
    color: #a7aaaf;
    font-weight: 400;
    white-space: nowrap;
}

/* Chart entrance animation */
.egpda-chart-container canvas {
    animation: egpda-chart-in 0.5s ease both;
}
@keyframes egpda-chart-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Metric card gradients */
.dashboard-box.egpda-metric-card#egpda-total-sales   { background: linear-gradient(135deg, #1a1c4b 0%, #0d0f6b 100%); }
.dashboard-box.egpda-metric-card#egpda-net-sales     { background: linear-gradient(135deg, #0d3b2e 0%, #0a5c2a 100%); }
.dashboard-box.egpda-metric-card#egpda-total-orders  { background: linear-gradient(135deg, #2a0b4e 0%, #3d1070 100%); }
.dashboard-box.egpda-metric-card#egpda-total-products{ background: linear-gradient(135deg, #0c2240 0%, #0e3060 100%); }
/* ─── Chart subtitle (e.g. "4.2%" shown inline in h5) ──────────────────────── */
.egpda-chart-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3c434a;
    margin-left: 8px;
    opacity: 0.75;
}

/* ─── Chart Cards ───────────────────────────────────────────────────────────── */
.egpda-chart-card {
    min-height: 400px;
}
.egpda-line-graph-card {
    min-height: 420px;
}
.egpda-chart-card .egpda-chart-container {
    min-height: 220px;
}
.egpda-chart-card h5 {
    font-size: 0.875rem;
    color: #1d2327;
}
.egpda-chart-card .egpda-card-footer {
    justify-content: center;
    text-align: center;
    font-size: 12px;
    border-top: none;
    padding-top: 0;
    margin-top: 5px;
}

/* ─── Chart Containers & States ─────────────────────────────────────────────── */
.dashboard-box .egpda-chart-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    width: 100%;
    position: relative;
    margin-bottom: 15px;
}
.dashboard-box canvas { max-width: 100%; max-height: 100%; display: block; }
.egpda-chart-error,
.egpda-chart-no-data,
.egpda-chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 100px;
    padding: 15px;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    flex-grow: 1;
}
.egpda-chart-error   { color: #721c24; background-color: #fdf3f3; border: 1px solid #f5c6cb; }
.egpda-chart-no-data { color: #0c5460; background-color: #e8f7fa; border: 1px solid #bee5eb; }
.egpda-chart-loading { color: #1d2327; background-color: #f8f9fa; }

/* ─── Placeholder Cards (Pro Feature Locked) ────────────────────────────────── */
.egpda-pro-placeholder {
    background: #ffffff;
    border: 1px solid #e8eaed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 150px;
    height: 100%;
    border-radius: 10px;
    padding: 28px 24px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.egpda-pro-placeholder::before {
    /* Subtle diagonal stripe background to signal "locked" state */
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(0,0,0,0.018) 8px,
        rgba(0,0,0,0.018) 16px
    );
    pointer-events: none;
    border-radius: inherit;
}
.egpda-pro-placeholder:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.09);
    transform: translateY(-2px);
}
/* Lock icon */
.egpda-pro-placeholder .dashicons:not(.egpda-upgrade-button .dashicons) {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #c0c5cd;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}
/* "Pro" badge top-right */
.egpda-pro-placeholder::after {
    content: 'PRO';
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #013440, #015c70);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 3px 8px;
    border-radius: 20px;
    font-family: inherit;
}
.egpda-pro-placeholder h5 {
    color: #1d2327;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 0.95em;
    text-transform: none;
    letter-spacing: 0;
    position: relative;
    z-index: 1;
}
.egpda-pro-placeholder .placeholder-description {
    font-size: 12.5px;
    color: #646970;
    margin-top: 0;
    margin-bottom: 18px;
    max-width: 90%;
    line-height: 1.55;
    position: relative;
    z-index: 1;
}
.egpda-pro-placeholder p:not(.placeholder-description) {
    font-size: 12.5px;
    color: #646970;
    margin-bottom: 18px;
    max-width: 90%;
    position: relative;
    z-index: 1;
}
.egpda-pro-placeholder .egpda-upgrade-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    border: none;
    color: #fff !important;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
    box-shadow: 0 2px 8px rgba(27,94,32,0.25);
    position: relative;
    z-index: 1;
}
.egpda-pro-placeholder .egpda-upgrade-button:hover,
.egpda-pro-placeholder .egpda-upgrade-button:focus {
    box-shadow: 0 4px 14px rgba(27,94,32,0.4);
    transform: translateY(-1px);
    color: #fff !important;
}
.egpda-pro-placeholder .egpda-upgrade-button .dashicons {
    font-size: 14px;
    width: auto;
    height: auto;
    color: #f0c040;
    margin-bottom: 0;
    line-height: inherit;
    vertical-align: text-bottom;
}

/* ─── Table ─────────────────────────────────────────────────────────────────── */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 12px; }
.egpda-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 860px;
}
.egpda-table thead th {
    padding: 10px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e4e7;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #787c82;
    text-align: left;
    white-space: nowrap;
}
.egpda-table tbody td {
    padding: 13px 14px;
    vertical-align: middle;
    color: #3c434a;
    border-bottom: 1px solid #f6f7f8;
    line-height: 1.4;
}
.egpda-table tbody tr:last-child td { border-bottom: none; }
.egpda-table tbody tr:hover td { background: #fafafa; }

/* Column sizing — Order · Customer · Item · Qty · Total · Payment · Status · Date */
.egpda-col-order   { width: 7%;  min-width: 62px;  white-space: nowrap; }
.egpda-col-customer{ width: 14%; min-width: 120px; }
.egpda-col-items   { width: 22%; }
.egpda-col-qty     { width: 4%;  text-align: center; }
.egpda-col-total   { width: 10%; text-align: right; white-space: nowrap; font-weight: 600; color: #1d2327; }
.egpda-col-payment { width: 12%; color: #50575e; }
.egpda-col-status  { width: 11%; text-align: center; }
.egpda-col-date    { width: 20%; white-space: nowrap; color: #787c82; font-size: 12px; }
.egpda-table thead th:nth-child(4) { text-align: center; }
.egpda-table thead th:nth-child(5) { text-align: right; }

/* Order # link */
.egpda-col-order a {
    font-weight: 700;
    color: #1d2327;
    text-decoration: none;
}
.egpda-col-order a:hover { color: #2271b1; text-decoration: underline; }

/* Customer avatar + name */
.egpda-col-customer {
    display: flex; /* overridden by table layout — use span approach instead */
}
.egpda-table td.egpda-col-customer {
    display: table-cell; /* keep as table cell */
}
.egpda-col-customer > * { vertical-align: middle; }
.egpda-customer-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #1a56db;
    font-size: 11px;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
    vertical-align: middle;
}
.egpda-customer-name {
    vertical-align: middle;
}

/* Items cell — truncate long text */
.egpda-col-items {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Status column — align header and cell consistently */
.egpda-table th.egpda-col-status,
.egpda-table td.egpda-col-status {
    text-align: left;
    white-space: nowrap;
}

/* Status badge — fixed width so all badges are the same size regardless of label */
.egpda-table .order-status {
    display: inline-block;
    min-width: 96px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    color: #fff;
    text-align: center;
    box-sizing: border-box;
}

/* Empty state */
.egpda-table-empty {
    text-align: center;
    padding: 32px !important;
    color: #787c82;
    font-size: 13px;
}

/* Table footer */
.egpda-table-footer {
    padding: 12px 16px;
    font-size: 12px;
    color: #787c82;
    text-align: center;
    border-top: 1px solid #f0f0f1;
    flex-shrink: 0;
    line-height: 1.6;
}
.egpda-table-footer a { color: #2271b1; text-decoration: none; font-weight: 500; }
.egpda-table-footer a:hover { text-decoration: underline; }

/* Absolute counts below chart */
.egpda-absolute-counts {
    font-size: 11px;
    color: #50575e;
    text-align: center;
    padding: 8px 0;
    border-top: 1px solid #eee;
    margin-top: 5px;
    flex-shrink: 0;
}
.egpda-absolute-counts strong { color: #1d2327; }

/* ─── Top Controls Bar ──────────────────────────────────────────────────────── */
.egpda-top-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    border: 1px solid #f0f0f1;
}
.egpda-top-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #3c434a;
    margin-bottom: 0;
}
#egpda-date-range {
    padding: 8px 40px 8px 12px;
    border: 1.5px solid #dcdcde;
    border-radius: 6px;
    min-width: 240px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2350575E' class='bi bi-calendar-event' viewBox='0 0 16 16'%3E%3Cpath d='M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z'/%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E") no-repeat right 12px center;
    background-size: 15px 15px;
    cursor: pointer;
    height: auto;
    line-height: normal;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
    transition: border-color .15s ease, box-shadow .15s ease;
    font-family: inherit;
    font-size: 13px;
    color: #1d2327;
}
#egpda-date-range:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.18);
    outline: none;
}
#egpda-date-range[readonly] { background-color: #fff; }
.egpda-top-controls .button {
    height: auto;
    line-height: normal;
    padding: 7px 16px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    border-radius: 6px;
}

/* ─── Dashboard Header ──────────────────────────────────────────────────────── */
.egpda-lite-container h1.wp-heading-inline,
.egpda-lite-container > h1:first-of-type {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d2327;
    letter-spacing: -0.01em;
}
.egpda-pro-button {
    background: linear-gradient(135deg, #2e7d32, #1b5e20) !important;
    border-color: transparent !important;
    color: #ffffff !important;
    text-shadow: none !important;
    box-shadow: 0 2px 6px rgba(27, 94, 32, 0.35) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    font-size: 13px !important;
    padding: 6px 16px !important;
    transition: box-shadow 0.2s ease, transform 0.15s ease !important;
}
.egpda-pro-button:hover,
.egpda-pro-button:focus {
    box-shadow: 0 4px 10px rgba(27, 94, 32, 0.45) !important;
    transform: translateY(-1px) !important;
    color: #fff !important;
}

/* ─── Refresh Controls ──────────────────────────────────────────────────────── */
.egpda-refresh-container {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
#egpda-last-updated {
    font-size: 11px;
    color: #787c82;
    display: flex;
    align-items: center;
    gap: 4px;
}
/* Live dot pulse replaces the dashicon — see "Live Data Dot" section above */
#egpda-manual-refresh {
    padding: 5px 6px !important;
    height: auto !important;
    line-height: 1 !important;
    border-radius: 6px !important;
}
#egpda-manual-refresh .dashicons {
    line-height: inherit;
    vertical-align: middle;
    font-size: 16px;
    transition: transform 0.5s ease;
}
#egpda-manual-refresh .dashicons.spin {
    animation: egpda-spin 1.2s infinite linear;
}

/* ─── Upgrade / Upsell Pages ────────────────────────────────────────────────── */
.egpda-upgrade-page h1, .egpda-upsell-page h1 { margin-bottom: 0.5em; font-weight: 700; }
.egpda-upgrade-page .upgrade-intro, .egpda-upsell-page .upsell-intro { font-size: 1.15em; color: #50575e; margin-bottom: 1.5em; max-width: 700px; line-height: 1.6; }

.egpda-upgrade-page .upgrade-header {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 2.5em 3em;
    text-align: center;
    margin-bottom: 2em;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.egpda-upgrade-page .upgrade-header h1 { font-size: 2.4em; margin-top: 0; margin-bottom: 0.2em; color: #1d2327; }
.egpda-upgrade-page .upgrade-header p  { font-size: 1.15em; color: #50575e; max-width: 680px; margin: 0 auto 1.5em; }

.egpda-upgrade-page .upgrade-screenshot { margin-bottom: 2.5em; text-align: center; }
.egpda-upgrade-page .upgrade-screenshot img { max-width: 100%; border-radius: 10px; box-shadow: 0 12px 36px rgba(0,0,0,0.12); border: 1px solid #e2e4e7; }

.egpda-upgrade-page .comparison-table {
    width: 100%; border-collapse: collapse; margin-bottom: 2.5em;
    background: #fff; border-radius: 10px; overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); border: 1px solid #e2e4e7;
}
.egpda-upgrade-page .comparison-table th,
.egpda-upgrade-page .comparison-table td { padding: 14px 20px; text-align: left; border-bottom: 1px solid #f0f0f1; }
.egpda-upgrade-page .comparison-table th { background-color: #f6f7f7; font-size: 1em; color: #2c3338; font-weight: 700; }
.egpda-upgrade-page .comparison-table td:nth-child(2),
.egpda-upgrade-page .comparison-table td:nth-child(3),
.egpda-upgrade-page .comparison-table th:nth-child(2),
.egpda-upgrade-page .comparison-table th:nth-child(3) { text-align: center; }
.egpda-upgrade-page .comparison-table .feature-name { font-weight: 500; color: #1d2327; }
.egpda-upgrade-page .comparison-table .icon-check { color: #2ca866; font-size: 1.4em; }
.egpda-upgrade-page .comparison-table .icon-cross { color: #d63638; font-size: 1.4em; }
.egpda-upgrade-page .comparison-table tr:last-child td { border-bottom: none; }

.egpda-upgrade-page .final-cta {
    text-align: center;
    padding: 2.5em;
    background: linear-gradient(135deg, #0d1117 0%, #1d2327 100%);
    color: #fff;
    border-radius: 12px;
}
.egpda-upgrade-page .final-cta h2 { color: #fff; margin-top: 0; font-size: 1.8em; }
.egpda-upgrade-page .final-cta p  { color: rgba(255,255,255,0.8); font-size: 1.1em; }

/* CTA Buttons */
.egpda-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    font-size: 1.05em;
    font-weight: 700;
    color: #fff !important;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    border: none;
    border-radius: 8px;
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(27,94,32,0.3);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
}
.egpda-cta-button:hover {
    box-shadow: 0 6px 18px rgba(27,94,32,0.4);
    transform: translateY(-2px);
    color: #fff !important;
}
.egpda-upgrade-page .egpda-cta-button.upgrade-cta-main { font-size: 1.15em; padding: 13px 28px; }

.egpda-cta-button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    font-size: 1.05em;
    font-weight: 700;
    color: #013440 !important;
    background-color: #fff;
    border: 1.5px solid #013440;
    border-radius: 8px;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    cursor: pointer;
    text-align: center;
    margin-left: 10px;
    font-family: inherit;
}
.egpda-cta-button-secondary:hover {
    background-color: #f4f7f8;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    transform: translateY(-1px);
    color: #013440 !important;
}

/* ─── Customer Insights Upsell Page ─────────────────────────────────────────── */
.egpda-upsell-customer-insights .egpda-upsell-header {
    background: #ffffff;
    padding: 35px 40px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 32px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
    border: 1px solid #e2e4e7;
}
.egpda-upsell-customer-insights .egpda-upsell-header-icon { font-size: 52px; width: 52px; height: 52px; color: #013440; margin-bottom: 16px; display: inline-block; }
.egpda-upsell-customer-insights .egpda-upsell-header h1 { font-size: 2em; color: #1d2327; margin-top: 0; margin-bottom: 10px; }
.egpda-upsell-customer-insights .upsell-intro { font-size: 1.05em; color: #50575e; max-width: 650px; margin: 0 auto 25px; }
.egpda-upsell-customer-insights .egpda-upsell-cta { padding: 11px 26px; }
.egpda-upsell-customer-insights .egpda-upsell-section-title { text-align: center; font-size: 1.5em; margin-bottom: 1.5em; color: #1d2327; font-weight: 700; }

.egpda-upsell-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    margin-bottom: 32px;
}
.egpda-upsell-feature-card {
    background: #fff;
    padding: 26px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-align: center;
    border: 1px solid #f0f0f1;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.egpda-upsell-feature-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
.egpda-upsell-feature-icon { width: 58px; height: 58px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.egpda-upsell-feature-icon .dashicons { font-size: 26px; color: #fff; width: auto; height: auto; }
.egpda-upsell-feature-card h3 { font-size: 1.1em; color: #1d2327; margin-top: 0; margin-bottom: 8px; font-weight: 600; }
.egpda-upsell-feature-card p  { font-size: 13px; color: #50575e; line-height: 1.55; margin-bottom: 0; }
.egpda-upsell-footer { text-align: center; margin-top: 32px; padding-top: 28px; border-top: 1px solid #e0e0e0; }
.egpda-upsell-footer p { font-size: 1.1em; color: #3c434a; margin-bottom: 20px; }

/* ─── Admin Menu ────────────────────────────────────────────────────────────── */
.egpda-menu-pro-badge { background-color: #5cb85c; color: #fff; padding: 1px 6px; border-radius: 10px; font-size: 9px; vertical-align: middle; margin-left: 4px; display: inline-block; line-height: 1.3; font-weight: 600; }
#adminmenu .egpda-menu-upgrade { color: #00a32a !important; font-weight: bold !important; }

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1400px) {
    .egpda-grid-container > .egpda-metric-card,
    .egpda-grid-container > .egpda-pro-placeholder[style*="span 3"],
    .egpda-grid-container > div[style*="grid-column: span 4"] { grid-column: span 6 !important; }
    .egpda-grid-container > div[style*="grid-column: span 8"] { grid-column: span 12 !important; }
}
@media (max-width: 960px) {
    .egpda-grid-container { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important; }
    .egpda-grid-container > div[style*="grid-column: span"] { grid-column: auto !important; }
    .egpda-grid-container > div[style*="grid-column: 1 / -1"],
    .egpda-grid-container > div[style*="grid-column: span 12"] { grid-column: 1 / -1 !important; }
}
@media (max-width: 782px) {
    .egpda-top-controls { flex-direction: column; align-items: stretch; }
    #egpda-date-range { min-width: 100%; }
    .egpda-top-controls .button { width: 100%; text-align: center; justify-content: center; margin-left: 0 !important; }
    .egpda-grid-container { grid-template-columns: 1fr !important; gap: 14px; }
    .egpda-grid-container > div[style*="grid-column"] { grid-column: span 1 !important; }
    .dashboard-box { padding: 16px; }
    .egpda-metric-card .h2 { font-size: 1.8rem; }
    .egpda-table { font-size: 12px; min-width: 0; }
    .egpda-table th, .egpda-table td { padding: 8px 6px; }
    .egpda-table .order-status { font-size: 0.78em; padding: 2px 7px; min-width: 80px; }
    .egpda-refresh-container { margin-left: 0; }
}

/* ─── Animations ────────────────────────────────────────────────────────────── */
@keyframes egpda-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(359deg); }
}
@keyframes egpda-card-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Stagger metric card animations — nth-child 2 = first card (1 = section header) */
#egpda-total-sales   .egpda-animate-value { animation-delay: 0.05s; }
#egpda-net-sales     .egpda-animate-value { animation-delay: 0.12s; }
#egpda-total-orders  .egpda-animate-value { animation-delay: 0.19s; }
#egpda-total-products .egpda-animate-value { animation-delay: 0.26s; }

/* Card entrance stagger */
.egpda-grid-container > *:nth-child(2) { animation-delay: 0.00s; }
.egpda-grid-container > *:nth-child(3) { animation-delay: 0.05s; }
.egpda-grid-container > *:nth-child(4) { animation-delay: 0.10s; }
.egpda-grid-container > *:nth-child(5) { animation-delay: 0.15s; }

/* ─── Date Range Cap Hint ───────────────────────────────────────────────────── */
.egpda-date-cap-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #787c82;
    padding: 7px 18px;
    background: #f8f9fa;
    border: 1px solid #f0f0f1;
    border-top: none;
    border-radius: 0 0 10px 10px;
    margin-top: -10px;
    margin-bottom: 10px;
    line-height: 1.5;
}
.egpda-date-cap-hint .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #a7aaaf;
}
.egpda-date-cap-hint a {
    color: #2271b1;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.egpda-date-cap-hint a:hover { text-decoration: underline; }
.egpda-date-cap-hint--active {
    background: #fff8e5;
    border-color: #f0c040;
    color: #5a4200;
}
.egpda-date-cap-hint--active .dashicons { color: #c08400; }

/* ─── Dashboard Upgrade Banner ──────────────────────────────────────────────── */
.egpda-upgrade-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: linear-gradient(135deg, #1d2327 0%, #2c3338 100%);
    color: #fff;
    border-radius: 10px;
    padding: 18px 24px;
    margin-top: 16px;
}
.egpda-upgrade-banner-text {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255,255,255,0.85);
    flex: 1;
}
.egpda-upgrade-banner-text strong {
    color: #fff;
    font-weight: 600;
    margin-right: 4px;
}
.egpda-upgrade-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.egpda-upgrade-banner-cta:hover {
    opacity: 0.9;
    color: #fff !important;
}
.egpda-upgrade-banner-cta .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}
@media (max-width: 782px) {
    .egpda-upgrade-banner { flex-direction: column; align-items: flex-start; }
    .egpda-upgrade-banner-cta { width: 100%; justify-content: center; }
}

/* ─── Teaser Cards (Abandoned Carts, Coupon Performance) ────────────────────── */
.egpda-teaser-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}
.egpda-teaser-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.egpda-teaser-header .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #50575e;
    flex-shrink: 0;
}
.egpda-teaser-header h5 {
    margin: 0 !important;
    flex-grow: 1;
}

/* Pro badge */
.egpda-pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, #013440, #015c70);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Teaser metric (big number) */
.egpda-teaser-metric {
    margin-bottom: 14px;
}
.egpda-teaser-count {
    font-size: 2rem;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}
.egpda-teaser-label {
    font-size: 12px;
    color: #787c82;
    margin-top: 4px;
}

/* Locked value row */
.egpda-teaser-locked-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #f8f9fa;
    border: 1px dashed #dcdcde;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #3c434a;
}
.egpda-teaser-locked-row .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #a7aaaf;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Blurred / locked value */
.egpda-blurred-value {
    display: inline-block;
    filter: blur(4px);
    user-select: none;
    color: #1d2327;
    font-weight: 700;
    margin-left: 4px;
}

/* Teaser empty / note */
.egpda-teaser-empty {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding: 12px 0;
}
.egpda-teaser-empty p { color: #50575e; font-size: 13px; margin: 0 0 6px; }
.egpda-teaser-note {
    font-size: 12px;
    color: #787c82;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Inline upgrade link in card footer */
.egpda-inline-upgrade-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #013440 !important;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.15s ease;
}
.egpda-inline-upgrade-link:hover { color: #015c70 !important; text-decoration: underline; }
.egpda-inline-upgrade-link .dashicons {
    font-size: 13px;
    width: 13px;
    height: 13px;
    color: #f0ad4e;
    flex-shrink: 0;
}

/* ─── Coupon Performance Card ───────────────────────────────────────────────── */
.egpda-coupon-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.egpda-coupon-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
}
.egpda-coupon-code {
    font-family: monospace;
    font-weight: 700;
    color: #1d2327;
    flex-grow: 1;
    letter-spacing: 0.05em;
}
.egpda-coupon-uses {
    font-size: 12px;
    color: #50575e;
    white-space: nowrap;
}
.egpda-coupon-value-locked {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    cursor: default;
}
.egpda-coupon-value-locked .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
    color: #a7aaaf;
}
.egpda-coupon-more {
    text-align: center;
    margin-top: 4px;
    font-size: 12px;
}
.egpda-coupon-more a { color: #2271b1; text-decoration: none; font-weight: 500; }
.egpda-coupon-more a:hover { text-decoration: underline; }

/* ─── Misc ──────────────────────────────────────────────────────────────────── */
.daterangepicker { z-index: 100100 !important; font-family: 'Jost', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; }
.spinner.is-active { float: none; vertical-align: middle; margin-right: 5px; }
#egpda-ajax-spinner { vertical-align: middle; }

/* ════════════════════════════════════════════════════════════════════════════
   CUSTOMER INSIGHTS UPSELL PAGE
   ════════════════════════════════════════════════════════════════════════════ */

/* ─── Breadcrumb ────────────────────────────────────────────────────────────── */
.egpda-upsell-breadcrumb {
    margin-bottom: 20px;
}
.egpda-upsell-breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #646970;
    text-decoration: none;
    transition: color 0.15s ease;
}
.egpda-upsell-breadcrumb a:hover { color: #2271b1; }
.egpda-upsell-breadcrumb a .dashicons { font-size: 15px; width: auto; height: auto; }

/* ─── Hero ──────────────────────────────────────────────────────────────────── */
.egpda-upsell-hero {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    padding: 52px 48px 44px;
    text-align: center;
    margin-bottom: 48px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.egpda-upsell-header-icon {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: #013440;
    margin-bottom: 16px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.egpda-upsell-hero h1 {
    font-size: 2.2em;
    font-weight: 700;
    color: #1d2327;
    margin: 0 0 16px;
    line-height: 1.25;
}
.egpda-upsell-hero-sub {
    font-size: 1.05em;
    color: #50575e;
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.7;
}
.egpda-upsell-hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.egpda-upsell-hero-footnote {
    font-size: 12px;
    color: #a7aaaf;
    margin: 0;
}

/* ─── Section title ─────────────────────────────────────────────────────────── */
.egpda-upsell-section-title {
    font-size: 1.25em;
    font-weight: 600;
    color: #1d2327;
    text-align: center;
    margin: 0 0 24px;
}

/* ─── Feature grid ──────────────────────────────────────────────────────────── */
.egpda-upsell-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 48px;
}
.egpda-upsell-feature-card {
    background: #fff;
    border: 1px solid #f0f0f1;
    border-radius: 10px;
    padding: 28px 22px;
    text-align: center;
    transition: box-shadow 0.2s ease;
}
.egpda-upsell-feature-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}
.egpda-upsell-feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.egpda-upsell-feature-icon .dashicons { font-size: 22px; color: #fff; width: auto; height: auto; }
.egpda-upsell-feature-card h3 {
    font-size: 0.95em;
    font-weight: 600;
    color: #1d2327;
    margin: 0 0 8px;
}
.egpda-upsell-feature-card p {
    font-size: 13px;
    color: #646970;
    line-height: 1.6;
    margin: 0;
}

/* ─── Final CTA ─────────────────────────────────────────────────────────────── */
.egpda-upsell-final-cta {
    text-align: center;
    padding: 48px 40px;
    background: #1d2327;
    border-radius: 12px;
    margin-bottom: 24px;
}
.egpda-upsell-final-cta h2 {
    font-size: 1.6em;
    font-weight: 700;
    color: #fff;
    margin: 0 0 24px;
}
.egpda-final-cta-btn {
    font-size: 1.05em !important;
    padding: 13px 28px !important;
}
.egpda-final-cta-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin: 14px 0 0;
}

/* ─── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 782px) {
    .egpda-upsell-hero { padding: 36px 24px 32px; }
    .egpda-upsell-hero h1 { font-size: 1.7em; }
    .egpda-upsell-hero-actions { flex-direction: column; align-items: stretch; }
    .egpda-upsell-hero-actions .egpda-cta-button,
    .egpda-upsell-hero-actions .egpda-cta-button-secondary { width: 100%; justify-content: center; margin-left: 0; }
    .egpda-upsell-final-cta { padding: 36px 22px; }
}
