/* AGC Dashboard - Styles */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.screen {
    display: flex;
}

#login-screen {
    height: 100vh;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
}

.login-box {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    min-width: 360px;
}

.login-box h1 {
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.login-box input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.login-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-box button {
    width: 100%;
    padding: 0.875rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-box button:hover {
    background: var(--primary-dark);
}

.error {
    color: var(--danger);
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Dashboard Screen */
#dashboard-screen {
    flex-direction: column;
    padding: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--bg-hover);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 2rem;
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Actions Bar */
.actions-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--bg-hover);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #dc2626;
}

#search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Table */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-hover);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

tr:hover td {
    background: var(--bg-hover);
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Status Badge */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-online {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.status-stopped,
.status-offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-errored {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Config badges */
.config-badges {
    display: flex;
    gap: 0.25rem;
}

.badge {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

/* Action buttons */
.action-btns {
    display: flex;
    gap: 0.375rem;
}

.action-btn {
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg-hover);
}

.action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.modal-sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.modal-body input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 1rem;
}

.modal-body input:focus {
    outline: none;
    border-color: var(--primary);
}

.hint {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem;
    border-top: 1px solid var(--border);
}

.deploy-output {
    max-height: 200px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: 8px;
    margin: 1rem;
    font-family: monospace;
    font-size: 0.75rem;
    white-space: pre-wrap;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Domain link */
.domain-link {
    color: var(--primary);
    text-decoration: none;
}

.domain-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .actions-bar {
        flex-direction: column;
    }

    .table-container {
        overflow-x: auto;
    }

    th,
    td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* ========== Phase 2 Styles ========== */

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab.active {
    color: var(--primary);
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Panels */
.panel {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.panel-body {
    padding: 1.25rem;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

/* List Container */
.list-container {
    max-height: 400px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item .name {
    font-weight: 500;
}

.list-item .count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* SSL Status */
.ssl-valid {
    color: var(--success);
}

.ssl-warning {
    color: var(--warning);
}

.ssl-critical {
    color: var(--danger);
}

/* Modal Large */
.modal-lg {
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}

/* Details Tabs */
.details-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.details-tab {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.details-tab:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.details-tab.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.details-content {
    display: none;
}

.details-content.active {
    display: block;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.info-item {
    padding: 0.75rem;
    background: var(--bg-dark);
    border-radius: 8px;
}

.info-item .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.info-item .value {
    font-weight: 600;
}

/* Config Form */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.config-field label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.config-field input {
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.config-field input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Logs Viewer */
.logs-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.logs-viewer {
    background: var(--bg-dark);
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Clickable row */
tr.clickable {
    cursor: pointer;
}

tr.clickable:hover td {
    background: var(--bg-hover);
}

/* ========== Phase 3 Styles ========== */

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 100;
    min-width: 160px;
    margin-top: 0.25rem;
}

.dropdown-menu button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
}

.dropdown-menu button:hover {
    background: var(--bg-hover);
}

.dropdown-menu button:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-menu button:last-child {
    border-radius: 0 0 8px 8px;
}

/* Activity Log */
.activity-list {
    max-height: 500px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    min-width: 80px;
}

.activity-icon {
    font-size: 1.25rem;
}

.activity-content {
    flex: 1;
}

.activity-action {
    font-weight: 500;
}

.activity-domain {
    color: var(--primary);
}

.activity-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Health Status */
.health-healthy {
    color: var(--success);
}

.health-unhealthy {
    color: var(--danger);
}

.health-icon {
    font-size: 1.25rem;
}

/* Progress Bar for Bulk Actions */
.bulk-progress {
    display: none;
    margin-top: 1rem;
}

.bulk-progress.active {
    display: block;
}

.progress-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-align: center;
}

/* Bulk Results Modal */
.bulk-results {
    max-height: 300px;
    overflow-y: auto;
}

.result-success {
    color: var(--success);
}

.result-failed {
    color: var(--danger);
}

/* ========== Phase 4 Styles ========== */

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Checkbox in label */
.config-field label input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* Deploy Output */
.deploy-output {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* Charts Container */
.chart-container {
    width: 100%;
    height: 200px;
    position: relative;
}

/* Simple Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 150px;
    padding: 0.5rem;
    background: var(--bg-dark);
    border-radius: 8px;
}

.bar {
    flex: 1;
    background: var(--primary);
    min-width: 3px;
    border-radius: 2px 2px 0 0;
    transition: height 0.3s ease;
}

.bar:hover {
    background: var(--primary-hover);
}

/* Stat Mini Card */
.stat-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.stat-mini:last-child {
    border-bottom: none;
}

.stat-mini .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-mini .value {
    font-weight: 600;
    font-size: 1rem;
}

/* Status Indicator (pulsing) */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ========== Phase 5: Visitor Analytics Styles ========== */

/* Visitor Stats Grid */
.visitor-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.visitor-stats-grid .stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.visitor-stats-grid .stat-icon {
    font-size: 2rem;
}

.visitor-stats-grid .stat-info {
    display: flex;
    flex-direction: column;
}

.visitor-stats-grid .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.visitor-stats-grid .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Visitor Grid */
.visitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.panel-wide {
    grid-column: 1 / -1;
}

/* Realtime Badge */
.realtime-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: auto;
    animation: pulse 2s infinite;
}

/* Select Dropdowns */
.select-domain,
.select-days {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
}

.select-domain:focus,
.select-days:focus {
    outline: none;
    border-color: var(--primary);
}

/* Breakdown List */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-name {
    color: var(--text-primary);
    font-weight: 500;
}

.breakdown-count {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.breakdown-bar {
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    margin-top: 0.25rem;
    transition: width 0.3s ease;
}

/* Top Pages List */
.top-pages-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.top-page-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--bg-dark);
    border-radius: 6px;
}

.top-page-path {
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.875rem;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-page-views {
    color: var(--primary);
    font-weight: 600;
}

/* Tracking Code */
.tracking-code {
    display: block;
    background: var(--bg-dark);
    padding: 1rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--success);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

/* Small Button */
.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* Bar Chart with labels */
.bar-chart {
    position: relative;
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 0.5rem;
    min-height: 220px;
}

.bar-chart svg {
    display: block;
}

.chart-label {
    fill: var(--text-secondary);
    font-size: 11px;
    font-family: inherit;
}

.chart-grid {
    stroke: var(--border);
    stroke-width: 1;
    stroke-dasharray: 4, 4;
}

.chart-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-point {
    fill: #3b82f6;
    stroke: white;
    stroke-width: 2;
    cursor: pointer;
    transition: r 0.2s ease;
}

.chart-point:hover {
    r: 6;
}

.chart-tooltip {
    position: absolute;
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 100;
}

/* ========== Site Config Editor Styles ========== */

.config-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.config-section:last-of-type {
    border-bottom: none;
}

.config-section h4 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.env-editor {
    width: 100%;
    min-height: 200px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    color: var(--success);
    resize: vertical;
    line-height: 1.5;
}

.env-editor:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========== Live Log Stream Styles ========== */

.log-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 15px;
    background: var(--bg-dark);
    border-radius: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.log-select {
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    min-width: 150px;
}

.log-search {
    flex: 1;
    min-width: 200px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
}

.log-search:focus {
    outline: none;
    border-color: var(--primary);
}

.log-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.log-status {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 12px;
    background: var(--bg-dark);
}

.log-help {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 8px 15px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    margin-bottom: 10px;
}

.log-help code {
    background: var(--bg-dark);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary);
}

.log-terminal {
    background: #0d1117;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    height: 500px;
    overflow-y: auto;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.log-placeholder {
    color: var(--text-secondary);
    text-align: center;
    padding: 50px;
}

.log-entry {
    padding: 6px 0;
    border-bottom: 1px solid #21262d;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    word-break: break-word;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.02);
}

.log-time {
    color: #6b7280;
    flex-shrink: 0;
    font-size: 11px;
}

.log-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 80px;
    text-align: center;
}

.log-type.bot {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.log-type.google-bot {
    background: rgba(66, 133, 244, 0.2);
    color: #4285f4;
}

.log-type.bing-bot {
    background: rgba(0, 131, 115, 0.2);
    color: #00a67e;
}

.log-type.seo-bot {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.log-type.visitor {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.log-ip {
    color: #60a5fa;
    flex-shrink: 0;
    min-width: 120px;
}

.log-country {
    flex-shrink: 0;
    font-size: 14px;
}

.log-domain {
    color: #a78bfa;
    flex-shrink: 0;
}

.log-url {
    color: #94a3b8;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
}

.log-ua {
    color: #6b7280;
    font-size: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    cursor: help;
}

/* ========== Pagination Styles ========== */

.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 0 0 var(--radius) var(--radius);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-left,
.pagination-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pagination-left label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

#items-per-page,
#report-per-page {
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

#pagination-info,
#report-pagination-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-page {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#page-numbers,
#report-page-numbers {
    display: flex;
    gap: 0.25rem;
}

#page-numbers .page-num,
#report-page-numbers .page-num {
    min-width: 32px;
    padding: 0.5rem;
    text-align: center;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

#page-numbers .page-num:hover,
#report-page-numbers .page-num:hover {
    border-color: var(--primary);
}

#page-numbers .page-num.active,
#report-page-numbers .page-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

#page-numbers .page-ellipsis,
#report-page-numbers .page-ellipsis {
    padding: 0.5rem;
    color: var(--text-secondary);
}

#page-jump,
#report-page-jump {
    width: 80px;
    padding: 0.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.875rem;
}

#page-jump:focus,
#report-page-jump:focus {
    outline: none;
    border-color: var(--primary);
}

/* Email column style */
.email-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.email-cell.no-email {
    color: var(--text-secondary);
    opacity: 0.5;
    font-style: italic;
}

/* ==========================================
   Domain Report
   ========================================== */

/* Sortable column headers */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.sortable:hover {
    background: var(--bg-hover);
}

.sortable.sort-active {
    color: var(--primary);
}

.sort-arrow {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Traffic cells */
.traffic-cell {
    font-weight: 600;
    text-align: center;
}

.traffic-zero {
    color: #ef4444;
    opacity: 0.7;
}

.traffic-active {
    color: #22c55e;
}

/* Report pagination page numbers - styles inherited from above */