/**
 * Modern Dashboard Styles.
 */
.utm-attribution-dashboard {
    max-width: 1200px;
    margin: 20px auto 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e293b;
}

.utm-attribution-dashboard h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #0f172a;
}

/* Filters Section */
.utm-attribution-filters {
    background: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

/* Preset buttons */
.utm-filter-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.utm-preset-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.5;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.utm-preset-btn:hover {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #c7d2fe;
}

.utm-preset-btn.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

/* Divider between presets and daterange */
.utm-filter-divider {
    width: 1px;
    height: 28px;
    background: #e2e8f0;
    flex-shrink: 0;
}

/* Date range row */
.utm-daterange-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.utm-daterange-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.utm-daterange-field label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    line-height: 1;
}

.utm-daterange-field input[type="date"] {
    padding: 5px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    background: #f8fafc;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    min-width: 130px;
}

.utm-daterange-field input[type="date"]:focus {
    border-color: #6366f1;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.utm-date-arrow {
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    padding-top: 14px;
}

.utm-apply-btn.button {
    background: #6366f1 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0 16px !important;
    height: 32px !important;
    font-weight: 600 !important;
    margin-top: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}

.utm-apply-btn.button:hover {
    background: #4f46e5 !important;
}

/* KPI Cards Grid */
.utm-attribution-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.utm-attribution-dashboard .kpi-card {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.utm-attribution-dashboard .kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.utm-attribution-dashboard .kpi-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.utm-attribution-dashboard .kpi-card h3 .dashicons {
    color: #94a3b8;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.utm-attribution-dashboard .kpi-card .value {
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

/* Charts and Tables Section */
.utm-attribution-charts {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 24px;
}

.utm-attribution-charts h3,
.utm-attribution-tables h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.utm-export-campaigns {
    font-size: 12px !important;
    margin-left: auto !important;
}

.utm-attribution-tables {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.utm-attribution-dashboard table.wp-list-table {
    border: none;
    box-shadow: none;
}

.utm-attribution-dashboard table.wp-list-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.utm-attribution-dashboard table.wp-list-table tbody td {
    padding: 16px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.utm-attribution-dashboard table.wp-list-table tbody tr:hover td {
    background: #fdfeff;
}

.utm-attribution-dashboard table.wp-list-table tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 782px) {
    .utm-attribution-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .utm-filter-divider {
        width: 100%;
        height: 1px;
    }
    .utm-daterange-row {
        flex-direction: column;
        align-items: stretch;
    }
    .utm-date-arrow {
        display: none;
    }
    .utm-apply-btn.button {
        margin-top: 0 !important;
        width: 100%;
    }
}
