/* ShadowScan Plugin - WordPress Admin Compatible Styles */

/* Design Tokens */
:root {
  --ss-color-ok: #10b981;
  --ss-color-warn: #f59e0b;
  --ss-color-bad: #ef4444;
  --ss-color-primary: #2271b1;
  --ss-color-border: #c3c4c7;
  --ss-color-border-light: #e2e8f0;
  --ss-color-bg-subtle: #f8fafc;
  --ss-color-bg-muted: #f6f7f7;
  --ss-color-text: #1d2327;
  --ss-color-text-secondary: #646970;
  --ss-radius-sm: 4px;
  --ss-radius-md: 6px;
  --ss-radius-lg: 8px;
  --ss-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --ss-shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --ss-transition: 0.2s ease;
}

/* Base App Container */
.shadowscan-app {
  background: #fff;
  margin: 20px 20px 20px 0;
  border: 1px solid var(--ss-color-border);
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.shadowscan-wrap {
  background: #fff;
  padding: 20px;
  max-width: 1400px;
}

/* Typography */
.shadowscan-wrap h1 {
  font-size: 23px;
  font-weight: 400;
  margin: 0 0 15px;
  color: var(--ss-color-text);
  line-height: 1.3;
}

.shadowscan-wrap h2 {
  font-size: 1.3em;
  margin: 1em 0 0.5em;
  color: var(--ss-color-text);
}

.shadowscan-wrap h3 {
  font-size: 1.1em;
  margin: 1em 0;
  color: var(--ss-color-text);
}

.shadowscan-subtitle,
.shadowscan-muted,
.shadowscan-note {
  color: var(--ss-color-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* Cards & Sections */
.shadowscan-card,
.shadowscan-section {
  background: #fff;
  border: 1px solid var(--ss-color-border);
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

/* Grid Layout */
.shadowscan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin: 15px 0;
}

/* Badges */
.shadowscan-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.shadowscan-badge.is-ok,
.shadowscan-badge-success {
  background: #10b981;
  color: #fff;
}

.shadowscan-badge.is-warn,
.shadowscan-badge-warning {
  background: #f59e0b;
  color: #fff;
}

.shadowscan-badge.is-bad,
.shadowscan-badge-error {
  background: #ef4444;
  color: #fff;
}

.shadowscan-badge-info {
  background: #22d3ee;
  color: #fff;
}

/* Tabs */
.shadowscan-tabs {
  display: flex;
  gap: 8px;
  margin: 15px 0;
  border-bottom: 1px solid var(--ss-color-border);
  padding-bottom: 0;
}

.shadowscan-tab {
  padding: 10px 15px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: #f6f7f7;
  color: #2c3338;
  text-decoration: none;
  cursor: pointer;
  margin-bottom: -1px;
}

.shadowscan-tab:hover {
  background: #fff;
}

.shadowscan-tab.is-active {
  background: #fff;
  border-color: var(--ss-color-border);
  border-bottom-color: #fff;
  color: var(--ss-color-text);
  font-weight: 600;
}

.shadowscan-access-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--ss-color-border);
  border-left: 4px solid var(--ss-color-primary);
  border-radius: 4px;
  background: #fff;
}

.shadowscan-access-status.is-warning {
  border-left-color: var(--ss-color-warn);
  background: #fffbeb;
}

.shadowscan-access-status.is-active {
  border-left-color: var(--ss-color-ok);
  background: #ecfdf5;
}

.shadowscan-access-status-main {
  min-width: 0;
}

.shadowscan-access-status-label {
  font-weight: 600;
  color: var(--ss-color-text);
}

.shadowscan-access-status-summary {
  margin-top: 4px;
  color: var(--ss-color-text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.shadowscan-access-status-actions {
  flex-shrink: 0;
}

.shadowscan-locked-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  background: #fffbeb;
}

.shadowscan-locked-summary-title {
  font-weight: 600;
  color: var(--ss-color-text);
  margin-bottom: 4px;
}

.shadowscan-local-intro,
.shadowscan-onboarding-checklist {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--ss-color-border);
  border-radius: 8px;
  background: #f8fafc;
}

.shadowscan-local-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.shadowscan-local-intro-title {
  font-weight: 600;
  color: var(--ss-color-text);
  margin-bottom: 4px;
}

.shadowscan-onboarding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.shadowscan-onboarding-steps {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.shadowscan-onboarding-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid var(--ss-color-border);
  border-radius: 8px;
  background: #fff;
}

.shadowscan-onboarding-step.is-complete {
  background: #f0fdf4;
  border-color: #86efac;
}

.shadowscan-onboarding-step.is-optional {
  background: #fffbeb;
  border-color: #fcd34d;
}

.shadowscan-onboarding-step-main {
  min-width: 0;
}

.shadowscan-advanced-toggle {
  margin-bottom: 16px;
}

.shadowscan-advanced-toggle--topright {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.shadowscan-advanced-toggle--topright .button {
  font-size: 12px;
  color: var(--ss-color-text-secondary);
}

.shadowscan-advanced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.shadowscan-advanced-action-button {
  min-height: 36px;
}

.shadowscan-advanced-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ss-color-border-light);
}

.shadowscan-advanced-mode-copy {
  min-width: 0;
}

.shadowscan-advanced-mode-button {
  white-space: nowrap;
}

/* Summary Strip */
.shadowscan-summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 15px;
  background: #f6f7f7;
  border: 1px solid var(--ss-color-border);
  border-radius: 4px;
  margin: 15px 0;
}

.shadowscan-summary-strip > div {
  flex: 1;
  min-width: 150px;
}

.shadowscan-summary-strip strong {
  display: block;
  font-size: 24px;
  color: var(--ss-color-text);
  margin-top: 5px;
}

.shadowscan-summary-strip strong.is-muted {
  color: var(--ss-color-text-secondary);
  font-size: 18px;
}

.shadowscan-summary-strip .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  vertical-align: text-bottom;
  margin-right: 4px;
}

.shadowscan-summary-strip .dashicons.is-ok {
  color: #10b981;
}

.shadowscan-summary-strip .dashicons.is-warn {
  color: #f59e0b;
}

.shadowscan-summary-strip .dashicons.is-bad {
  color: #ef4444;
}

/* Status Rows */
.shadowscan-status-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #dcdcde;
  background: #fff;
}

.shadowscan-status-row:last-child {
  border-bottom: none;
}

.shadowscan-status-row:hover {
  background: #f6f7f7;
}

.shadowscan-status-row .dashicons {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  font-size: 20px;
}

.shadowscan-status-row.is-ok .dashicons {
  color: #10b981;
}

.shadowscan-status-row.is-warn .dashicons {
  color: #f59e0b;
}

.shadowscan-status-row.is-bad .dashicons {
  color: #ef4444;
}

.shadowscan-status-text {
  flex: 1;
}

.shadowscan-status-list {
  margin: 0;
  padding: 0;
}

/* Buttons */
.shadowscan-wrap .button,
.shadowscan-wrap button.button {
  font-size: 13px;
  line-height: 2.15384615;
  min-height: 30px;
  margin: 0;
  padding: 0 10px;
  cursor: pointer;
  border-width: 1px;
  border-style: solid;
  border-radius: 3px;
  white-space: nowrap;
  box-sizing: border-box;
}

.shadowscan-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Forms */
.shadowscan-wrap input[type="text"],
.shadowscan-wrap input[type="email"],
.shadowscan-wrap textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  background-color: #fff;
  color: #2c3338;
  font-size: 14px;
  line-height: 1.5;
}

.shadowscan-wrap input[type="text"]:focus,
.shadowscan-wrap input[type="email"]:focus,
.shadowscan-wrap textarea:focus {
  border-color: #2271b1;
  outline: none;
  box-shadow: 0 0 0 1px #2271b1;
}

.shadowscan-wrap textarea {
  min-height: 150px;
  resize: vertical;
}

.shadowscan-wrap label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--ss-color-text);
}

/* Coverage Page Specific */
.ss-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.ss-stats-grid .card {
  margin: 0;
  padding: 15px;
  box-shadow: 0 1px 1px rgba(0,0,0,.04);
  border: 1px solid var(--ss-color-border);
}

.ss-stats-grid .card h3 {
  font-size: 14px;
  color: var(--ss-color-text-secondary);
  margin: 0 0 10px;
  font-weight: 400;
}

.ss-stats-grid .card p {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--ss-color-text);
}

/* Postbox */
.postbox .hndle {
  cursor: pointer;
}

.postbox .hndle .dashicons {
  color: #2271b1;
  margin-right: 5px;
}

.ss-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  margin-left: 10px;
}

.ss-badge-success {
  background: #10b981;
}

.ss-badge-warning {
  background: #f59e0b;
}

.ss-badge-error {
  background: #ef4444;
}

.postbox .inside ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.postbox .inside ul li {
  padding: 12px;
  border-bottom: 1px solid #dcdcde;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background-color 0.2s ease;
}

.postbox .inside ul li:hover {
  background-color: #f6f7f7;
}

.postbox .inside ul li:last-child {
  border-bottom: none;
}

.postbox .inside form label {
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
}

.postbox .inside form label:hover {
  color: #2271b1;
}

/* Responsive */
@media screen and (max-width: 782px) {
  .shadowscan-grid,
  .ss-stats-grid {
    grid-template-columns: 1fr !important;
  }

  .shadowscan-summary-strip {
    flex-direction: column;
  }

  .shadowscan-tabs {
    flex-direction: column;
  }

  .shadowscan-tab {
    border-radius: 4px;
    margin-bottom: 0;
  }
}

/* WordPress Notice Boxes */
.shadowscan-wrap .notice {
  margin: 15px 0;
}

/* Utility Classes */
.shadowscan-separator {
  margin: 0 8px;
  color: #8c8f94;
}

.shadowscan-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.shadowscan-coverage-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  line-height: 1.3;
  white-space: nowrap;
}

.shadowscan-coverage-pill.is-ok {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  color: #10b981;
}

.shadowscan-coverage-pill.is-warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
  color: #f59e0b;
}

.shadowscan-coverage-pill.is-bad {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #ef4444;
}

.shadowscan-coverage-pill.is-muted {
  background: rgba(100, 105, 112, 0.08);
  border-color: var(--ss-color-border);
  color: var(--ss-color-text-secondary);
}

.shadowscan-coverage-pill .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
  line-height: 14px;
}

/* Coverage Page Specific Styles */
.shadowscan-coverage-container {
  background: #fff;
  padding: 20px;
}

.shadowscan-coverage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--ss-color-border);
}

.shadowscan-control-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ss-color-text);
  margin: 0;
  line-height: 1.4;
}

.shadowscan-control-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ss-color-text);
  margin-bottom: 10px;
}

.shadowscan-coverage-summary-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

/* Filter Pills Row */
.shadowscan-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 20px 0;
}

.shadowscan-filter-more-toggle {
  background: none;
  border: 1px solid var(--ss-color-border);
  border-radius: var(--ss-radius);
  padding: 4px 10px;
  font-size: 13px;
  color: var(--ss-color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.5;
}

.shadowscan-filter-more-toggle:hover {
  border-color: var(--ss-color-text-secondary);
  color: var(--ss-color-text);
}

.shadowscan-filter-more {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  padding-top: 8px;
  border-top: 1px solid var(--ss-color-border-light);
}

.shadowscan-filter-more[hidden] {
  display: none;
}

.shadowscan-filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 20px 0;
}

.shadowscan-search {
  display: flex;
  gap: 6px;
  align-items: center;
}

.shadowscan-search input[type="search"] {
  min-width: 220px;
}

.shadowscan-search .shadowscan-search-clear {
  display: none;
}

.shadowscan-search.has-value .shadowscan-search-clear {
  display: inline-block;
}

.shadowscan-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shadowscan-search-count {
  font-size: 13px;
  color: var(--ss-color-text-secondary);
}

.shadowscan-filter {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--ss-color-border);
  background: #fff;
  color: #2c3338;
  transition: all 200ms ease;
}

.shadowscan-filter:hover {
  background: #f6f7f7;
  border-color: #8c8f94;
}

.shadowscan-filter.is-active {
  background: #22d3ee;
  border-color: #22d3ee;
  color: #0b1220;
}

/* Subtabs */
.shadowscan-subtabs {
  display: flex;
  gap: 8px;
  margin: 15px 0;
  border-bottom: 1px solid var(--ss-color-border);
  padding-bottom: 0;
}

.shadowscan-subtab {
  padding: 10px 15px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: #f6f7f7;
  color: #2c3338;
  cursor: pointer;
  margin-bottom: -1px;
  font-size: 13px;
}

.shadowscan-subtab:hover {
  background: #fff;
}

.shadowscan-subtab.is-active {
  background: #fff;
  border-color: var(--ss-color-border);
  border-bottom-color: #fff;
  color: var(--ss-color-text);
  font-weight: 600;
}

/* Coverage Group */
.shadowscan-coverage-group {
  margin-bottom: 30px;
}

.shadowscan-group-header {
  background: #fff;
  border: 1px solid var(--ss-color-border);
  border-radius: var(--ss-radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.shadowscan-summary-card {
  background: #fff;
  border: 1px solid var(--ss-color-border);
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
}

.shadowscan-summary-list {
  list-style: none;
  margin: 10px 0 0 0;
  padding: 0;
}

.shadowscan-summary-list li {
  padding: 8px 0;
  border-bottom: 1px solid #dcdcde;
  font-size: 13px;
  color: #2c3338;
}

.shadowscan-summary-list li:last-child {
  border-bottom: none;
}

/* Issue Links */
.shadowscan-issue-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2c3338;
  text-decoration: none;
  flex: 1;
}

.shadowscan-issue-link:hover {
  color: #2271b1;
}

.shadowscan-issue-link .dashicons {
  flex-shrink: 0;
}

.shadowscan-issue-arrow {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s;
  color: #2271b1;
}

.shadowscan-issue-link:hover .shadowscan-issue-arrow {
  opacity: 1;
}

.shadowscan-summary-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tab Badges */
.shadowscan-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  background: #ef4444;
  color: #fff;
}

.shadowscan-tab-badge.is-warn {
  background: #f59e0b;
}

.shadowscan-tab-badge.is-ok {
  background: #10b981;
}

/* Progress Section */
.shadowscan-progress-section {
  padding: 15px;
  background: #f6f7f7;
  border: 1px solid var(--ss-color-border);
  border-radius: 4px;
}

.shadowscan-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.shadowscan-progress-header .shadowscan-control-label {
  margin-bottom: 0;
}

.shadowscan-progress-value {
  font-size: 18px;
  font-weight: 600;
  color: #10b981;
}

.shadowscan-progress-bar {
  height: 10px;
  background: var(--ss-color-border-light);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}

.shadowscan-progress-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

/* Alert Banner */
.shadowscan-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 15px;
  border-radius: 4px;
  border: 1px solid;
}

.shadowscan-alert.is-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
}

.shadowscan-alert.is-bad {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
}

.shadowscan-alert > .dashicons {
  flex-shrink: 0;
  margin-top: 2px;
}

.shadowscan-alert.is-warn > .dashicons {
  color: #f59e0b;
}

.shadowscan-alert.is-bad > .dashicons {
  color: #ef4444;
}

.shadowscan-alert-content {
  flex: 1;
}

.shadowscan-alert .button {
  flex-shrink: 0;
  align-self: center;
}

.shadowscan-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
  gap: 15px;
}

.shadowscan-coverage-container,
.shadowscan-coverage-container * {
  box-sizing: border-box;
}

.shadowscan-card-grid > * {
  min-width: 0;
}

.shadowscan-coverage-card {
  background: #fff;
  border: 1px solid var(--ss-color-border);
  border-radius: 6px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}

.shadowscan-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.shadowscan-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shadowscan-row-main .shadowscan-muted,
.shadowscan-control-details {
  overflow-wrap: anywhere;
  margin: 0;
}

.shadowscan-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 160px;
  padding-top: 2px;
}

.shadowscan-row-meta .shadowscan-muted {
  text-align: right;
  font-size: 12px;
}

.shadowscan-card-details {
  margin-top: 4px;
}

.shadowscan-control-details {
  margin-top: 12px;
}

.ss-details-layout {
  display: block;
}

/* Single column layout for control details */
.shadowscan-control-columns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Collapsible section headers with icons */
.shadowscan-control-collapse > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  border: none;
  background: none;
}

.shadowscan-control-collapse > summary::-webkit-details-marker {
  display: none;
}

.shadowscan-control-collapse > summary.shadowscan-control-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0;
}

.shadowscan-control-collapse > summary .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 16px;
  flex-shrink: 0;
}

/* Colorized section icons */
.shadowscan-control-collapse > summary .dashicons.dashicons-info-outline {
  color: #2271b1;
}

.shadowscan-control-collapse > summary .dashicons.dashicons-shield {
  color: #10b981;
}

.shadowscan-control-collapse > summary .dashicons.dashicons-arrow-right-alt {
  color: #d97706;
}

.shadowscan-control-collapse[open] > summary {
  margin-bottom: 2px;
}

.shadowscan-control-section {
  margin-bottom: 8px;
}

.shadowscan-control-section:last-child {
  margin-bottom: 0;
}

/* Technical details section */
.shadowscan-tech-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #dcdcde;
}

.shadowscan-tech-details > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  color: var(--ss-color-text-secondary);
}

.shadowscan-tech-details > summary::-webkit-details-marker {
  display: none;
}

.shadowscan-tech-details > summary .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.shadowscan-tech-body {
  margin-top: 8px;
  padding-left: 20px;
  font-size: 12px;
}

/* Configuration details (collapsible) */
.shadowscan-config-details {
  margin-top: 12px;
}

.shadowscan-config-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0f6fc;
  border: 1px solid var(--ss-color-border);
  border-left: 3px solid #2271b1;
  border-radius: 4px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--ss-color-text);
}

.shadowscan-config-toggle::-webkit-details-marker {
  display: none;
}

.shadowscan-config-toggle:hover {
  background: #e8f0fe;
}

.shadowscan-config-toggle .dashicons {
  color: #2271b1;
}

.shadowscan-config-toggle::after {
  content: '';
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-right: 2px solid #646970;
  border-bottom: 2px solid #646970;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.shadowscan-config-details[open] > .shadowscan-config-toggle::after {
  transform: rotate(45deg);
}

/* Configuration card content */
.shadowscan-config-card {
  background: #f0f6fc;
  border: 1px solid var(--ss-color-border);
  border-top: none;
  border-left: 3px solid #2271b1;
  border-radius: 0 0 4px 4px;
  padding: 16px;
}

.shadowscan-config-card .shadowscan-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ss-color-border);
}

/* Styled radio button group */
.shadowscan-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.shadowscan-radio-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--ss-color-border);
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background-color 0.15s;
  font-weight: 400;
}

.shadowscan-radio-group label:hover {
  border-color: #2271b1;
  background: #fff;
}

.shadowscan-radio-group label.is-selected,
.shadowscan-radio-group label:has(input:checked) {
  border-color: #2271b1;
  background: #f0f6fc;
}

.shadowscan-radio-group input[type="radio"] {
  margin: 0;
  accent-color: #2271b1;
}

/* Monospace textarea for code/lists */
.shadowscan-code-textarea {
  font-family: Consolas, Monaco, 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  min-height: 80px;
  background: #fff;
}

/* View details button with chevron */
.shadowscan-card-details > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shadowscan-card-details > summary::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  margin-right: 2px;
}

.shadowscan-card-details[open] > summary::before {
  transform: rotate(45deg);
  margin-top: -2px;
}

/* Config section field styling */
.shadowscan-config-field {
  margin-bottom: 16px;
}

.shadowscan-config-field > label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 13px;
}

.shadowscan-config-field .shadowscan-muted {
  margin-top: 4px;
  font-size: 12px;
}

.shadowscan-pill-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 7px;
  flex-shrink: 0;
}

.shadowscan-coverage-pill.is-ok .shadowscan-pill-dot {
  background: #10b981;
}

.shadowscan-coverage-pill.is-warn .shadowscan-pill-dot {
  background: #f59e0b;
}

.shadowscan-coverage-pill.is-bad .shadowscan-pill-dot {
  background: #ef4444;
}

.shadowscan-note {
  color: var(--ss-color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0;
}

.shadowscan-hide-advanced .shadowscan-is-advanced {
  display: none !important;
}

.shadowscan-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000;
}

.shadowscan-modal.is-open {
  display: flex;
}

.shadowscan-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.shadowscan-modal-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--ss-color-border);
  border-radius: 6px;
  padding: 20px;
  width: min(520px, 92vw);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  z-index: 1;
}

/* Responsive */
@media screen and (max-width: 782px) {
  .shadowscan-coverage-header {
    flex-direction: column;
  }

  .shadowscan-subtabs {
    flex-direction: column;
  }

  .shadowscan-subtab {
    border-radius: 4px;
    margin-bottom: 5px;
  }

  .shadowscan-group-header {
    flex-direction: column;
  }

  .shadowscan-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   UX/UI Improvements
   ========================================================================== */

/* --- Health Overview (consolidated summary) --- */
.shadowscan-health-overview {
  background: var(--ss-color-bg-subtle);
  border: 1px solid var(--ss-color-border);
  border-radius: var(--ss-radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.shadowscan-health-top {
  display: flex;
  align-items: center;
  gap: 32px;
}

.shadowscan-score-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: conic-gradient(
    var(--ss-progress-color, var(--ss-color-ok)) calc(var(--ss-progress) * 1%),
    #e2e8f0 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.shadowscan-score-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--ss-color-bg-subtle);
}

.shadowscan-score-number {
  position: relative;
  z-index: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--ss-color-text);
}

.shadowscan-score-label {
  font-size: 13px;
  color: var(--ss-color-text-secondary);
  margin-top: 6px;
  text-align: center;
}

.shadowscan-health-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  flex: 1;
}

.shadowscan-stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ss-color-text);
}

.shadowscan-stat-item .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

.shadowscan-health-hero {
  margin-bottom: 20px !important;
}

.shadowscan-health-action-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ss-color-border-light);
  font-size: 14px;
  font-weight: 500;
  color: var(--ss-color-bad);
}

.shadowscan-health-action-strip--alert {
  color: var(--ss-color-bad);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--ss-radius);
  padding: 10px 16px;
  margin-top: 16px;
}

.shadowscan-health-action-strip--ok {
  color: var(--ss-color-ok);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--ss-radius);
  padding: 10px 16px;
  margin-top: 16px;
}

.shadowscan-health-action-strip .button {
  margin-left: auto;
}

/* --- Control Card Improvements --- */
.shadowscan-coverage-card {
  border-left: 4px solid var(--ss-color-border);
  transition: box-shadow var(--ss-transition), border-color var(--ss-transition);
}

.shadowscan-coverage-card:hover {
  box-shadow: var(--ss-shadow-md);
}

.shadowscan-coverage-card[data-status="action_required"] {
  border-left-color: var(--ss-color-bad);
}

.shadowscan-coverage-card[data-status="managed"] {
  border-left-color: var(--ss-color-warn);
}

.shadowscan-coverage-card[data-status="needs_host"] {
  border-left-color: var(--ss-color-warn);
}

.shadowscan-coverage-card[data-status="covered"] {
  border-left-color: var(--ss-color-ok);
}

.shadowscan-coverage-card[data-locked="1"] {
  background: #f8fafc;
  border-color: #d7dee7;
  box-shadow: none;
}

.shadowscan-coverage-card[data-locked="1"]:hover {
  box-shadow: none;
}

.shadowscan-coverage-card[data-locked="1"] .shadowscan-control-title {
  color: #334155;
}

.shadowscan-coverage-card[data-locked="1"] .shadowscan-muted,
.shadowscan-coverage-card[data-locked="1"] .shadowscan-note {
  color: #64748b;
}

.shadowscan-coverage-card[data-locked="1"] .button {
  opacity: 0.92;
}

/* Action callout for action_required cards */
.shadowscan-action-callout {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--ss-radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--ss-color-text);
  line-height: 1.5;
}

.shadowscan-action-callout .dashicons {
  color: var(--ss-color-bad);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Improved View details trigger */
.shadowscan-card-details > summary {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--ss-color-primary);
  cursor: pointer;
  border-radius: var(--ss-radius-sm);
  transition: background var(--ss-transition);
}

.shadowscan-card-details > summary:hover {
  background: rgba(34, 113, 177, 0.06);
}

/* Card detail spacing */
.shadowscan-control-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--ss-color-border-light);
}

/* Card fade-in animation */
.shadowscan-coverage-card {
  animation: ssCardFadeIn 0.15s ease-out;
}

@keyframes ssCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Subtabs: Pill Navigation --- */
.shadowscan-subtabs {
  display: flex;
  gap: 6px;
  margin: 20px 0 16px;
  padding: 4px;
  background: #f0f0f1;
  border-radius: var(--ss-radius-lg);
  border: none;
  border-bottom: none;
}

.shadowscan-subtab {
  padding: 8px 16px;
  border: none;
  border-radius: var(--ss-radius-md);
  background: transparent;
  color: var(--ss-color-text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 0;
}

.shadowscan-subtab:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ss-color-text);
}

.shadowscan-subtab.is-active {
  background: #fff;
  color: var(--ss-color-text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-color: transparent;
  border-bottom-color: transparent;
}

/* --- Filter Pills: Status-Colored Active States --- */
.shadowscan-filter.is-active[data-status="actionable"] {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.shadowscan-filter.is-active[data-status="action_required"] {
  background: #fef2f2;
  border-color: var(--ss-color-bad);
  color: var(--ss-color-bad);
}

.shadowscan-filter.is-active[data-status="managed"],
.shadowscan-filter.is-active[data-status="needs_host"] {
  background: #fffbeb;
  border-color: var(--ss-color-warn);
  color: #b45309;
}

.shadowscan-filter.is-active[data-status="covered"] {
  background: #ecfdf5;
  border-color: var(--ss-color-ok);
  color: #059669;
}

.shadowscan-filter.is-active[data-status="all"] {
  background: var(--ss-color-primary);
  border-color: var(--ss-color-primary);
  color: #fff;
}

/* Count badges inside filter pills */
.shadowscan-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.08);
}

.shadowscan-filter.is-active .shadowscan-filter-count {
  background: rgba(255, 255, 255, 0.3);
}

.shadowscan-filter.is-active[data-status="actionable"] .shadowscan-filter-count {
  background: rgba(29, 78, 216, 0.14);
}

.shadowscan-configuration-group {
  margin-top: 16px;
}

/* --- Sidebar: Priority Actions (numbered) --- */
.shadowscan-priority-actions {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: priority;
}

.shadowscan-priority-actions li {
  counter-increment: priority;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 4px 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f1;
  font-size: 13px;
  line-height: 1.5;
}

.shadowscan-priority-title {
  grid-column: 2;
  font-weight: 600;
  color: var(--ss-color-text);
  font-size: 13px;
}

.shadowscan-priority-detail {
  grid-column: 2;
  color: var(--ss-color-text-secondary);
  font-size: 12px;
}

.shadowscan-priority-actions li .shadowscan-matter-link {
  grid-column: 2;
}

.shadowscan-priority-actions li:last-child {
  border-bottom: none;
}

.shadowscan-priority-actions li::before {
  content: counter(priority);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ss-color-border-light);
  color: var(--ss-color-text);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Sidebar: Key-Value List */
.shadowscan-kv-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 13px;
}

.shadowscan-kv-list dt {
  color: var(--ss-color-text-secondary);
  white-space: nowrap;
}

.shadowscan-kv-list dd {
  margin: 0;
  color: var(--ss-color-text);
  font-weight: 500;
}

.shadowscan-matter-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--ss-color-primary);
  text-decoration: none;
}

.shadowscan-matter-link:hover {
  text-decoration: underline;
}

.shadowscan-matter-link .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

/* --- Progress Bar Polish --- */
.shadowscan-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: ssProgressShimmer 2s infinite;
}

@keyframes ssProgressShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Focus & Accessibility --- */
.shadowscan-subtab:focus-visible,
.shadowscan-filter:focus-visible,
.shadowscan-coverage-card:focus-visible {
  outline: 2px solid var(--ss-color-primary);
  outline-offset: 2px;
}

/* --- Responsive Improvements --- */
@media screen and (max-width: 960px) {
  .shadowscan-card-grid {
    grid-template-columns: 1fr;
  }

  .shadowscan-grid {
    grid-template-columns: 1fr !important;
  }

  .shadowscan-health-top {
    flex-direction: column;
    text-align: center;
  }

  .shadowscan-health-stats {
    justify-content: center;
  }
}

@media screen and (max-width: 782px) {
  .shadowscan-access-status,
  .shadowscan-locked-summary,
  .shadowscan-local-intro,
  .shadowscan-onboarding-header,
  .shadowscan-onboarding-step,
  .shadowscan-advanced-mode-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .shadowscan-subtabs {
    flex-direction: column;
  }

  .shadowscan-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
}
