/* Incidents tab. Mirrors the 404 Errors overview/table styles; every selector stays local to .atk-incidents. */
.atk-incidents { padding-top: 12px; color: #1d2327; }
.atk-incidents-muted { color: #646970; font-size: 12px; }

/* Header + overview (same box, heading and status pill as the 404 tab) */
.atk-incidents-overview { margin: 8px 0 20px; padding: 20px; border: 1px solid #dcdcde; border-radius: 4px; background: #fff; }
.atk-incidents-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.atk-incidents-heading h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 20px; font-weight: 600; color: #1d2327; }
.atk-incidents-heading h2 .dashicons { color: #2271b1; }
.atk-incidents-heading-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.atk-incidents-inline-form { display: inline; margin: 0; }
.atk-incidents-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 20px; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.atk-incidents-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.atk-incidents-status-active { background: #e9f5ee; color: #166534; }
.atk-incidents-status-off { background: #f0f0f1; color: #50575e; }
.atk-incidents-status-delayed { background: #fff4d6; color: #92400e; }
.atk-incidents #atk-incidents-overview-toggle { color: #2271b1; text-decoration: none; line-height: 1.5; }
.atk-incidents #atk-incidents-overview-toggle:hover { color: #135e96; text-decoration: underline; }
.atk-incidents-summary { margin-top: 6px; }
.atk-incidents-intro { margin: 0 0 18px; color: #646970; font-size: 13px; }
.atk-incidents-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.atk-incidents-info-card { padding: 16px; border: 1px solid #e2e4e7; border-radius: 3px; background: #f6f7f7; min-width: 0; }
.atk-incidents-info-card h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; color: #50575e; font-size: 12px; font-weight: 600; }
.atk-incidents-info-card h3 .dashicons { width: 16px; height: 16px; font-size: 16px; color: #646970; }
.atk-incidents-info-card > strong { display: block; color: #1d2327; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.atk-incidents-info-card p { margin: 8px 0 0; color: #646970; font-size: 13px; line-height: 1.6; }
.atk-incidents-overview-hidden .atk-incidents-summary { display: none; }
.atk-incidents-overview-hidden .atk-incidents-overview { padding: 10px 16px; margin-bottom: 12px; }
.atk-incidents-overview-hidden .atk-incidents-heading { align-items: center; }

/* Notices (same treatment as the 404 recording notice) */
.atk-incidents-notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #e7d8b5; border-radius: 6px; background: #fffbef; color: #6b4f16; }
.atk-incidents-notice-success { border-color: #b8e0c6; background: #f0f9f3; color: #1e5c37; }
.atk-incidents-notice > .dashicons { margin-top: 1px; flex-shrink: 0; }
.atk-incidents-notice strong { display: block; font-size: 13px; line-height: 1.5; }
.atk-incidents-notice p { margin: 3px 0 0; font-size: 13px; line-height: 1.6; }

/* Filters + table (WordPress list-table look, like the 404 tab) */
.atk-incidents .tablenav { height: auto; min-height: 32px; }
.atk-incidents .tablenav::after { content: ''; display: block; clear: both; }
.atk-incidents .tablenav .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0; }
.atk-incidents .tablenav .actions select, .atk-incidents .tablenav .actions .button { margin: 0; }
.atk-incidents .atk-incidents-bulk[hidden] { display: none; }
.atk-incidents-table .check-column { width: 2.2em; padding: 8px 0 8px 3px; vertical-align: top; }
.atk-incidents .search-box { margin: 0; display: flex; gap: 6px; }
.atk-incidents .search-box input[type="search"] { width: 200px; }
.atk-incidents-table td { vertical-align: top; overflow-wrap: anywhere; }
.atk-incidents-table .column-priority { width: 120px; }
.atk-incidents-table .column-account { width: 20%; }
.atk-incidents-table .column-activity { width: 17%; }
.atk-incidents-table .column-status { width: 110px; }
.atk-incidents-table td small { display: block; margin-top: 2px; color: #646970; font-size: 12px; }
.atk-incidents-table .row-title { font-size: 14px; }
.atk-incidents-story { display: block; margin-top: 4px; color: #50575e; font-size: 12.5px; }
.atk-incidents-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 5px; font-size: 12px; }
.atk-incidents-row-actions .atk-incidents-view { display: inline-flex; align-items: center; gap: 4px; color: #2271b1; font-size: 12px; font-weight: 400; line-height: 18px; text-decoration: none; }
.atk-incidents-view .dashicons { width: 14px; height: 14px; font-size: 14px; }
.atk-incidents .dashicons::before,
#atk-incidents-dialog .dashicons::before { display: inline-block; text-decoration: none; }
.atk-incidents-row-actions .atk-incidents-view:hover { color: #135e96; text-decoration: none; }
.atk-incidents-view:hover .atk-incidents-view-label { text-decoration: underline; }
.atk-incidents-row-actions .atk-incidents-view:focus-visible { outline: 2px solid #2271b1; outline-offset: 3px; }
.atk-incidents-table .no-items td { padding: 18px 10px; color: #50575e; }
.atk-incidents-ok { color: #166534; }
.atk-incidents-user { display: flex; align-items: center; gap: 8px; }
.atk-incidents-user .avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.atk-incidents-user > span { min-width: 0; }

/* Priority and incident status badges */
.atk-incidents-badge { display: inline-block; padding: 3px 9px; border-radius: 4px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.atk-incidents-open { color: #2271b1; background: #eef7ff; }
.atk-incidents-high { color: #b42318; background: #feeceb; }
.atk-incidents-review { color: #805600; background: #fff0cd; }

/* Empty / call to action */
.atk-incidents-empty { padding: 36px 20px; border: 1px solid #dcdcde; border-radius: 4px; background: #fff; text-align: center; }
.atk-incidents-empty > .dashicons { width: 32px; height: 32px; font-size: 32px; color: #2271b1; }
.atk-incidents-empty h3 { margin: 10px 0 6px; font-size: 15px; }
.atk-incidents-empty p { max-width: 60ch; margin: 0 auto; color: #646970; font-size: 13px; line-height: 1.6; }
.atk-incidents-empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Settings screen back link + panels */
.atk-incidents-back { margin: 0 0 10px; }
.atk-incidents-back a { text-decoration: none; }
.atk-incidents-panel { margin-bottom: 16px; padding: 16px 18px; border: 1px solid #dcdcde; border-radius: 4px; background: #fff; }
.atk-incidents-panel h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.atk-incidents-panel p { margin: 0 0 8px; font-size: 13px; line-height: 1.6; }
.atk-incidents-panel p:last-child { margin-bottom: 0; }

/* Incident dialog: same frame, heading, note and facts grid as the WooCommerce "Details" dialog */
#atk-incidents-dialog { box-sizing: border-box; top: 64px; bottom: auto; margin: 0 auto; width: min(760px, 95vw); max-width: 95vw; max-height: calc(100vh - 80px); padding: 0; border: 1px solid #c3c4c7; border-radius: 6px; background: #fff; color: #243247; }
#atk-incidents-dialog:not([open]) { display: none; }
#atk-incidents-dialog[open] { display: flex; flex-direction: column; }
#atk-incidents-dialog::backdrop { background: rgba(0, 0, 0, .45); }
#atk-incidents-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #dcdcde; }
#atk-incidents-dialog h2 { margin: 0; font-size: 20px; }
.atk-incidents-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; color: #50575e; text-decoration: none; }
.atk-incidents-close:hover { color: #1d2327; }
.atk-incidents-dialog-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 20px; overflow-wrap: anywhere; }
.atk-incidents-evidence-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.atk-incidents-evidence-heading h3 { margin: 0 0 4px; font-size: 16px; line-height: 1.5; }
.atk-incidents-evidence-heading small, .atk-incidents-facts dt, .atk-incidents-facts small { color: #646970; font-size: 12px; }
.atk-incidents-evidence-note { margin-top: 16px; padding: 10px 12px; border-left: 3px solid #c68a14; background: #fff8e7; }
.atk-incidents-evidence-note strong { display: block; font-size: 13px; }
.atk-incidents-evidence-note p { margin: 4px 0 0; font-size: 13px; line-height: 1.6; }
.atk-incidents-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 20px 0 0; }
.atk-incidents-facts dt { margin-bottom: 6px; }
.atk-incidents-facts dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; }
.atk-incidents-facts small { display: block; }
.atk-incidents-wide { grid-column: 1 / -1; }
.atk-incidents-facts .atk-incidents-user { text-decoration: none; }
.atk-incidents-facts .atk-incidents-user .avatar { width: 30px; height: 30px; }
.atk-incidents-user-name { color: #243247; font-weight: 500; }
.atk-incidents-timeline { list-style: none; margin: 0; padding: 0; }
.atk-incidents-timeline li { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 0 18px; margin: 0; padding: 0 0 12px; }
.atk-incidents-timeline li::before { content: ''; position: absolute; left: 105px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #8c8f94; }
.atk-incidents-timeline li::after { content: ''; position: absolute; left: 108px; top: 17px; bottom: 0; width: 2px; background: #e2e4e7; }
.atk-incidents-timeline li:last-child { padding-bottom: 0; }
.atk-incidents-timeline li:last-child::after { display: none; }
.atk-incidents-timeline li.atk-incidents-step-hot::before { background: #d63638; }
.atk-incidents-timeline li > span { padding-left: 8px; min-width: 0; }
.atk-incidents-timeline time { color: #646970; font-size: 12px; font-variant-numeric: tabular-nums; }
.atk-incidents-timeline small { color: #646970; }
.atk-incidents-checklist { margin: 0 0 8px 18px; padding: 0; list-style: decimal; }
.atk-incidents-checklist li { margin-bottom: 4px; }
.atk-incidents-links { display: flex; flex-wrap: wrap; gap: 14px; }
.atk-incidents-links a { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; text-decoration: none; }
.atk-incidents-links a:hover { text-decoration: underline; }
.atk-incidents-links .dashicons { width: 14px; height: 14px; font-size: 14px; }
.atk-incidents-dialog-footer { padding: 12px 20px; border-top: 1px solid #dcdcde; background: #f6f7f7; border-radius: 0 0 6px 6px; }
.atk-incidents-dialog-footer p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 13px; }
.atk-incidents-resolve { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.atk-incidents-resolve label { font-weight: 600; font-size: 13px; }
.atk-incidents-resolve select, .atk-incidents-resolve .button { margin: 0; }
.atk-incidents-resolve input[type="text"] { flex: 1 1 180px; min-width: 0; margin: 0; font-size: 14px; }
.atk-incidents-resolved { color: #1e604b; background: #e0f0e9; }
.atk-incidents-note { color: #50575e; font-style: italic; }

/* Settings */
.atk-incidents-settings .form-table th { width: 160px; }
.atk-incidents-settings .form-table td fieldset label, .atk-incidents-fieldset label { display: block; margin: 0 0 4px; }
.atk-incidents-settings .form-table td .description { margin: 2px 0 12px 24px; }
.atk-incidents-settings .form-table td > .description { margin-left: 0; }
.atk-incidents-fieldset { margin-top: 10px; }
.atk-incidents-settings .submit { margin: 4px 0 0; padding: 0; }
.atk-incidents-clear { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 8px; }

.atk-incidents a:focus-visible, .atk-incidents button:focus-visible { outline: 2px solid #2271b1; outline-offset: 2px; }
@media (max-width: 782px) {
    .atk-incidents-overview { padding: 16px; }
    .atk-incidents-heading { flex-wrap: wrap; }
    .atk-incidents-info-grid { grid-template-columns: 1fr; }
    .atk-incidents .search-box { float: none; margin-top: 8px; }
    .atk-incidents-table .column-account, .atk-incidents-table .column-status { display: none; }
    #atk-incidents-dialog header, .atk-incidents-dialog-content, .atk-incidents-dialog-footer { padding-left: 12px; padding-right: 12px; }
    .atk-incidents-facts { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .atk-incidents-timeline li { grid-template-columns: 1fr; padding-left: 18px; }
    .atk-incidents-timeline li::before { left: 0; }
    .atk-incidents-timeline li::after { left: 3px; }
    .atk-incidents-timeline li > span { padding-left: 0; }
}

/* 404 incidents */
.atk-incidents-facts .atk-incidents-paths { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.atk-incidents-paths code { padding: 1px 5px; border-radius: 3px; background: #f6f7f7; font-size: 11.5px; overflow-wrap: anywhere; }
.atk-incidents-notice-info { border-color: #c5d9ed; background: #f0f6fc; color: #1d3e5e; }

/* Pro: one quiet line for Free users, never a banner */
.atk-incidents-pro-note { color: #646970; font-size: 12px; line-height: 1.6; }
.atk-incidents-pro-note a { white-space: nowrap; }
.atk-incidents-pro-tag { display: inline-block; padding: 0 5px; border-radius: 3px; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; font-size: 10px; font-weight: 700; letter-spacing: .04em; line-height: 16px; vertical-align: 1px; }
.atk-incidents-locked { color: #646970; }
.atk-incidents-settings .atk-incidents-pro-line { margin: 4px 0 0; }

/* Pro AI explanation inside the incident dialog */
.atk-incident-ai-run { display: inline-flex !important; align-items: center; gap: 6px; }
.atk-incident-ai-run .atk-incident-ai-icon { display: block; width: 20px; height: 20px; flex-shrink: 0; }
.atk-incident-ai-result:not(:empty) { margin-top: 12px; }
.atk-incident-ai-result .atk-analysis .atk-analysis-overview { padding: 14px 16px; }
.atk-incident-ai-result .atk-analysis .atk-analysis-summary { font-size: 15px; }
.atk-incidents-ai-locked { margin: 0; color: #646970; font-size: 13px; }
