/* Date range picker */
.epictr-date-picker {
    position: relative;
    display: inline-block;
    margin: 16px 0;
}

.epictr-date-picker__trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 0 12px;
    height: 36px;
    font-size: 13px;
    color: #2c3338;
    cursor: pointer;
    line-height: 1;
    white-space: nowrap;
}

.epictr-date-picker__trigger:hover {
    border-color: #8c8f94;
}

.epictr-date-picker__trigger .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #787c82;
}

.epictr-date-picker__dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    margin-top: 4px;
    min-width: 280px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.epictr-date-picker__dropdown.is-open {
    display: block;
}

.epictr-date-picker__preset {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 9px 16px;
    border: none;
    background: none;
    font-size: 13px;
    color: #2c3338;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}

.epictr-date-picker__preset:hover {
    background: #f0f0f1;
}

.epictr-date-picker__check {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #2271b1;
    visibility: hidden;
}

.epictr-date-picker__separator {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 4px 16px;
}

.epictr-date-picker__custom {
    display: none;
    padding: 10px 16px 14px;
}

.epictr-date-picker__custom.is-visible {
    display: block;
}

.epictr-date-picker__custom-fields {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.epictr-date-picker__custom-fields input[type="date"] {
    flex: 1;
    padding: 4px 8px;
    height: 32px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    font-size: 13px;
    color: #2c3338;
    background: #fff;
    box-sizing: border-box;
}

.epictr-date-picker__apply {
    width: 100%;
}

/* Daily chart */
.epictr-chart {
    position: relative;
    padding: 20px;
}

.epictr-chart canvas {
    width: 100% !important;
    height: 280px !important;
    display: block;
}

.epictr-chart__tooltip {
    position: absolute;
    pointer-events: none;
    background: #1d2327;
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s;
}

.epictr-chart__tooltip.is-visible {
    opacity: 1;
}

.epictr-chart__legend {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.epictr-chart__legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #50575e;
}

.epictr-chart__legend-swatch {
    width: 12px;
    height: 3px;
    border-radius: 2px;
}

/* Summary stat cards */
.epictr-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media screen and (max-width: 960px) {
    .epictr-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.epictr-stat-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px 20px;
}

.epictr-stat-card-label {
    font-size: 12px;
    color: #787c82;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.epictr-stat-card-label .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    color: #a7aaad;
}

.epictr-stat-card-value {
    font-size: 28px;
    font-weight: 600;
    color: #1d2327;
    line-height: 1.2;
    margin: 0;
}

/* Dashboard grid */
.epictr-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 782px) {
    .epictr-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Section cards */
.epictr-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    overflow: hidden;
}

.epictr-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
    padding: 14px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.epictr-section-title .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #a7aaad;
}

/* Custom table */
.epictr-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.epictr-table thead th {
    text-align: left;
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #787c82;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
}

.epictr-table tbody td {
    padding: 12px 20px;
    color: #1d2327;
    border-bottom: 1px solid #f0f0f1;
    vertical-align: middle;
}

.epictr-table tbody tr:last-child td {
    border-bottom: none;
}

.epictr-table tbody tr:hover td {
    background: #f6f7f7;
}

/* Numeric columns — right-aligned */
.epictr-col-num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

/* Links in table */
.epictr-table a {
    color: #2271b1;
    text-decoration: none;
}

.epictr-table a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Code / tag styling */
.epictr-table code {
    font-size: 12px;
    font-family: Menlo, Consolas, Monaco, monospace;
    background: #f0f0f1;
    padding: 3px 7px;
    border-radius: 3px;
    color: #50575e;
}

/* Badge for event type */
.epictr-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    background: #f0f0f1;
    color: #50575e;
    text-transform: capitalize;
}

/* Active filter */
.epictr-active-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: #f0f6fc;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

.epictr-clear-filter {
    color: #d63638;
    text-decoration: none;
    font-size: 12px;
}

.epictr-clear-filter:hover {
    text-decoration: underline;
}

/* Pagination */
.epictr-pagination {
    padding: 12px 20px;
    text-align: right;
    border-top: 1px solid #f0f0f1;
}

.epictr-pagination .page-numbers {
    display: inline-block;
    min-width: 28px;
    padding: 4px 8px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    background: #f6f7f7;
    color: #2c3338;
    margin: 0 2px;
}

.epictr-pagination .page-numbers.current {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    font-weight: 600;
}

.epictr-pagination .page-numbers:hover:not(.current):not(.dots) {
    border-color: #2271b1;
    color: #2271b1;
}

.epictr-pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* Empty state */
.epictr-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #787c82;
}

.epictr-empty-state .dashicons {
    font-size: 36px;
    width: 36px;
    height: 36px;
    color: #dcdcde;
    display: block;
    margin: 0 auto 10px;
}

.epictr-empty-state p {
    margin: 0;
    font-size: 13px;
}

/* 2-column stat row (page detail) */
.epictr-stats-row--2col {
    grid-template-columns: repeat(2, 1fr);
}

/* 3-column breakdown grid (device / browser / OS) */
.epictr-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media screen and (max-width: 960px) {
    .epictr-breakdown-grid {
        grid-template-columns: 1fr;
    }

    .epictr-stats-row--2col {
        grid-template-columns: 1fr;
    }
}

/* Page detail header */
.epictr-page-detail-header {
    margin-bottom: 0;
}

.epictr-back-link {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #2271b1;
    text-decoration: none;
}

.epictr-back-link:hover {
    color: #135e96;
    text-decoration: underline;
}

/* View all link in section header */
.epictr-view-all {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: #2271b1;
    text-decoration: none;
}

.epictr-view-all:hover {
    color: #135e96;
    text-decoration: underline;
}

/* Sortable table headers */
.epictr-sortable a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.epictr-sortable a:hover {
    color: #2271b1;
}

.epictr-sortable a::after {
    content: '\2195';
    font-size: 10px;
    opacity: 0.3;
}

.epictr-sort-asc a::after {
    content: '\2191';
    opacity: 1;
    color: #2271b1;
}

.epictr-sort-desc a::after {
    content: '\2193';
    opacity: 1;
    color: #2271b1;
}
