/**
 * ========================================
 * ReOrderRe Analytics Dashboard
 * Professional SaaS Design System
 * Inspired by: Stripe, Datadog, Linear
 * ========================================
 */

/* ============================================
   FOUNDATION & VARIABLES
   ============================================ */

.wrap.rorder-dashboard {
    background: #f7f9fc;
    margin: 0 0 0 -20px;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TOP NAVIGATION BAR
   ============================================ */

.rorder-top-bar {
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-bottom: 1px solid #e1e4e8;
    padding: 24px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 32px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rorder-top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.rorder-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #0d1117;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    letter-spacing: -0.03em;
}

.rorder-page-title .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #ffffff;
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(79, 195, 247, 0.3);
}

.rorder-top-bar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rorder-date-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    padding: 11px 18px;
    border-radius: 10px;
    border: 1.5px solid #d0d7de;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.rorder-date-selector:hover {
    border-color: #4FC3F7;
    box-shadow: 0 3px 8px rgba(79, 195, 247, 0.2);
    transform: translateY(-1px);
}

.rorder-date-selector .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #57606a;
}

.rorder-select {
    border: none;
    background: transparent;
    font-size: 14px;
    color: #24292f;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding: 0;
}

.rorder-select option {
    font-weight: 500;
}

.rorder-btn {
    padding: 11px 22px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    white-space: nowrap;
}

.rorder-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.rorder-btn-primary {
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.35);
}

.rorder-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.45);
}

.rorder-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 195, 247, 0.35);
}

.rorder-btn-secondary {
    background: #ffffff;
    color: #24292f;
    border: 1.5px solid #d0d7de;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rorder-btn-secondary:hover {
    background: #f6f8fa;
    border-color: #4FC3F7;
    color: #4FC3F7;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

/* ============================================
   DASHBOARD CONTAINER
   ============================================ */

.rorder-dashboard-container {
    padding: 32px 40px;
    max-width: 1800px;
    margin: 0 auto;
}

/* ============================================
   METRICS CARDS GRID
   ============================================ */

.rorder-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.rorder-metric-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    border: 1px solid #e1e4e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.rorder-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4FC3F7 0%, #29B6F6 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rorder-metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.rorder-metric-card:hover::before {
    opacity: 1;
}

.rorder-metric-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.rorder-metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rorder-metric-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #ffffff;
}

.rorder-icon-blue {
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
}

.rorder-icon-green {
    background: linear-gradient(135deg, #66BB6A 0%, #43A047 100%);
}

.rorder-icon-purple {
    background: linear-gradient(135deg, #AB47BC 0%, #8E24AA 100%);
}

.rorder-icon-orange {
    background: linear-gradient(135deg, #FFA726 0%, #FB8C00 100%);
}

.rorder-icon-teal {
    background: linear-gradient(135deg, #26A69A 0%, #00897B 100%);
}

.rorder-icon-red {
    background: linear-gradient(135deg, #EF5350 0%, #E53935 100%);
}

.rorder-metric-content {
    flex: 1;
    min-width: 0;
}

.rorder-metric-label {
    font-size: 13px;
    font-weight: 600;
    color: #57606a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.rorder-metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #0d1117;
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.rorder-metric-trend {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rorder-trend-positive {
    color: #2da44e;
}

.rorder-trend-negative {
    color: #cf222e;
}

.rorder-metric-trend .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.rorder-metric-sublabel {
    font-size: 13px;
    color: #656d76;
    font-weight: 500;
    margin-top: 4px;
}

/* ============================================
   CHARTS ROW
   ============================================ */

.rorder-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.rorder-chart-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e1e4e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.rorder-chart-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f6f8fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rorder-chart-title {
    font-size: 18px;
    font-weight: 700;
    color: #0d1117;
    margin: 0;
    letter-spacing: -0.02em;
}

.rorder-chart-controls {
    display: flex;
    gap: 6px;
    background: #f6f8fa;
    padding: 4px;
    border-radius: 8px;
}

.rorder-time-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #57606a;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rorder-time-btn:hover {
    background: #ffffff;
    color: #24292f;
}

.rorder-time-btn-active {
    background: #ffffff;
    color: #4FC3F7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rorder-chart-body {
    padding: 20px 24px 24px;
    height: 360px;
    position: relative;
}

.rorder-chart-body canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 320px;
}

/* Donut Chart Specific Styles */
.rorder-donut-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 24px;
    padding: 12px;
}

.rorder-donut-wrapper canvas {
    max-width: 180px !important;
    max-height: 180px !important;
    flex-shrink: 0;
}

.rorder-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.rorder-legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f6f8fa;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.rorder-legend-item:hover {
    background: #ebeef1;
    transform: translateX(4px);
}

.rorder-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.rorder-legend-label {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #24292f;
}

.rorder-legend-value {
    font-size: 18px;
    font-weight: 700;
    color: #0d1117;
}

/* ============================================
   SECONDARY ROW (Products & Activity)
   ============================================ */

.rorder-secondary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.rorder-list-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e1e4e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.rorder-list-header {
    padding: 24px;
    border-bottom: 1px solid #f6f8fa;
}

.rorder-list-title {
    font-size: 18px;
    font-weight: 700;
    color: #0d1117;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.rorder-list-title .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: #4FC3F7;
}

.rorder-list-subtitle {
    font-size: 13px;
    color: #656d76;
    font-weight: 500;
    margin: 8px 0 0 0;
}

.rorder-list-body {
    padding: 0;
    max-height: 480px;
    overflow-y: auto;
}

.rorder-list-body::-webkit-scrollbar {
    width: 6px;
}

.rorder-list-body::-webkit-scrollbar-track {
    background: #f6f8fa;
}

.rorder-list-body::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border-radius: 3px;
}

.rorder-list-body::-webkit-scrollbar-thumb:hover {
    background: #afb8c1;
}

/* Product List Styles */
.rorder-product-list {
    padding: 8px 0;
}

.rorder-product-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f6f8fa;
}

.rorder-product-item:last-child {
    border-bottom: none;
}

.rorder-product-item:hover {
    background: #f6f8fa;
}

.rorder-product-rank {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
    color: #ffffff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.rorder-product-info {
    flex: 1;
    min-width: 0;
}

.rorder-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rorder-product-meta {
    font-size: 12px;
    color: #656d76;
    font-weight: 500;
}

.rorder-product-revenue {
    font-size: 16px;
    font-weight: 700;
    color: #0d1117;
    white-space: nowrap;
}

/* Activity Feed Styles */
.rorder-activity-feed {
    padding: 8px 0;
}

.rorder-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 24px;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f6f8fa;
}

.rorder-activity-item:last-child {
    border-bottom: none;
}

.rorder-activity-item:hover {
    background: #f6f8fa;
}

.rorder-activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rorder-activity-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #ffffff;
}

.rorder-activity-new .rorder-activity-icon {
    background: linear-gradient(135deg, #66BB6A 0%, #43A047 100%);
}

.rorder-activity-cancelled .rorder-activity-icon {
    background: linear-gradient(135deg, #EF5350 0%, #E53935 100%);
}

.rorder-activity-updated .rorder-activity-icon {
    background: linear-gradient(135deg, #4FC3F7 0%, #29B6F6 100%);
}

.rorder-activity-content {
    flex: 1;
    min-width: 0;
}

.rorder-activity-title {
    font-size: 14px;
    font-weight: 600;
    color: #24292f;
    margin-bottom: 6px;
}

.rorder-activity-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rorder-activity-status {
    font-size: 12px;
    font-weight: 600;
    color: #656d76;
}

.rorder-activity-time {
    font-size: 12px;
    color: #8c959f;
    font-weight: 500;
}

/* Empty State */
.rorder-empty-state {
    padding: 48px 24px;
    text-align: center;
    color: #656d76;
}

.rorder-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #d0d7de;
    margin-bottom: 12px;
}

.rorder-empty-state p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   DATA TABLE
   ============================================ */

.rorder-table-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e1e4e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.rorder-table-header {
    padding: 24px;
    border-bottom: 1px solid #f6f8fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.rorder-table-title {
    font-size: 18px;
    font-weight: 700;
    color: #0d1117;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.rorder-table-title .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: #4FC3F7;
}

.rorder-table-search {
    position: relative;
    max-width: 320px;
    flex: 1;
}

.rorder-table-search .dashicons {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #8c959f;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.rorder-table-search input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1.5px solid #d0d7de;
    border-radius: 10px;
    font-size: 14px;
    color: #24292f;
    transition: all 0.2s ease;
    outline: none;
    font-weight: 500;
}

.rorder-table-search input:focus {
    border-color: #4FC3F7;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

.rorder-table-search input::placeholder {
    color: #8c959f;
}

.rorder-table-body {
    overflow-x: auto;
}

.rorder-data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.rorder-data-table thead {
    background: #f6f8fa;
}

.rorder-data-table th {
    padding: 16px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #57606a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e1e4e8;
    white-space: nowrap;
}

.rorder-data-table tbody tr {
    transition: all 0.2s ease;
}

.rorder-data-table tbody tr:hover {
    background: #f6f8fa;
}

.rorder-data-table td {
    padding: 18px 20px;
    font-size: 14px;
    color: #24292f;
    border-bottom: 1px solid #f6f8fa;
    font-weight: 500;
}

.rorder-data-table td strong {
    color: #0d1117;
    font-weight: 700;
}

/* Status Badges */
.rorder-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
}

.rorder-badge-active {
    background: #ddf4ff;
    color: #0969da;
}

.rorder-badge-paused {
    background: #fff8c5;
    color: #9a6700;
}

.rorder-badge-cancelled {
    background: #ffebe9;
    color: #cf222e;
}

.rorder-badge-inactive {
    background: #ebeef1;
    color: #57606a;
}

.rorder-gateway-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #f6f8fa;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #57606a;
    text-transform: capitalize;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1400px) {
    .rorder-charts-row {
        grid-template-columns: 1fr;
    }
    
    .rorder-donut-wrapper {
        flex-direction: row;
        justify-content: center;
        gap: 32px;
    }
    
    .rorder-donut-wrapper canvas {
        max-width: 200px !important;
        max-height: 200px !important;
    }
    
    .rorder-legend {
        max-width: 300px;
    }
}

@media (max-width: 1200px) {
    .rorder-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .rorder-secondary-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .rorder-top-bar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        padding: 20px;
    }
    
    .rorder-top-bar-right {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .rorder-dashboard-container {
        padding: 24px 20px;
    }
    
    .rorder-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .rorder-table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rorder-table-search {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .rorder-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .rorder-metric-value {
        font-size: 28px;
    }
    
    .rorder-page-title {
        font-size: 22px;
    }
    
    .rorder-data-table {
        font-size: 12px;
    }
    
    .rorder-data-table th,
    .rorder-data-table td {
        padding: 12px 10px;
    }
}
