/* ==========================================================================
   DCC Care Home Scorer — Front-end & Admin Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Score Band Colours
   -------------------------------------------------------------------------- */

.dcc-band-exceptional {
    background: #6B21A8;
    color: #fff;
}

.dcc-band-highly-recommended {
    background: #15803D;
    color: #fff;
}

.dcc-band-good {
    background: #1D4ED8;
    color: #fff;
}

.dcc-band-developing {
    background: #D97706;
    color: #fff;
}

.dcc-band-requires-attention {
    background: #DC2626;
    color: #fff;
}

/* --------------------------------------------------------------------------
   Score Card — Front-end
   -------------------------------------------------------------------------- */

.dcc-score-card {
    font-family: inherit;
    max-width: 560px;
    margin: 1.5rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Composite badge */
.dcc-score-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.dcc-score-number {
    display: block;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.dcc-score-label {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dcc-score-subtitle {
    display: block;
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Pillars section */
.dcc-pillars {
    padding: 1.25rem 1.5rem 0.75rem;
}

.dcc-pillars-heading {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 1rem;
    padding: 0;
}

.dcc-pillar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.dcc-pillar-meta {
    display: flex;
    flex-direction: column;
    min-width: 170px;
    max-width: 170px;
}

.dcc-pillar-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dcc-pillar-weight {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* Progress bar */
.dcc-bar-track {
    flex: 1;
    height: 10px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
}

.dcc-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
}

.dcc-bar-green { background: #16a34a; }
.dcc-bar-amber { background: #d97706; }
.dcc-bar-red   { background: #dc2626; }

.dcc-pillar-score {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
    min-width: 28px;
    text-align: right;
}

/* Meta info */
.dcc-score-meta {
    padding: 0.75rem 1.5rem 1.25rem;
    border-top: 1px solid #f3f4f6;
}

.dcc-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

.dcc-meta-icon {
    font-size: 0.9rem;
}

/* Placeholder */
.dcc-score-placeholder {
    font-style: italic;
    color: #6b7280;
    padding: 1rem 0;
}

/* --------------------------------------------------------------------------
   Compare Chart
   -------------------------------------------------------------------------- */

.dcc-compare-chart {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.dcc-compare-heading {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.dcc-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.dcc-compare-table th,
.dcc-compare-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.dcc-compare-table th {
    text-align: left;
    font-weight: 600;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f9fafb;
}

.dcc-compare-name {
    font-weight: 500;
    color: #111827;
}

.dcc-band-badge {
    display: inline-block;
    padding: 0.15em 0.55em;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.dcc-compare-band-label {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 2px;
}

.dcc-mini-bar-wrap {
    height: 6px;
    background: #e5e7eb;
    border-radius: 99px;
    overflow: hidden;
    min-width: 60px;
    display: inline-block;
    width: 80px;
    vertical-align: middle;
}

.dcc-mini-bar {
    height: 100%;
    border-radius: 99px;
}

.dcc-mini-score {
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.35rem;
    vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Admin Dashboard
   -------------------------------------------------------------------------- */

.dcc-admin-wrap .nav-tab-wrapper {
    margin-bottom: 0;
}

.dcc-admin-wrap .tab-content {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-top: none;
    padding: 1.5rem;
}

.dcc-dashboard {
    max-width: 1100px;
}

/* Stats row */
.dcc-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dcc-stat-card {
    flex: 1 1 180px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
}

.dcc-stat-excluded {
    border-color: #fca5a5;
    background: #fef2f2;
}

.dcc-stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.dcc-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.3rem;
}

/* Sections */
.dcc-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.dcc-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.dcc-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    padding: 0;
}

/* Inline status messages */
.dcc-inline-status {
    display: inline-block;
    margin-left: 0.75rem;
    font-size: 0.85rem;
    vertical-align: middle;
}

.dcc-inline-status.is-success { color: #15803d; }
.dcc-inline-status.is-error   { color: #dc2626; }

/* Approve button */
.dcc-btn-approve {
    background: #15803d !important;
    border-color: #15803d !important;
    color: #fff !important;
    font-size: 1rem !important;
    padding: 0.5rem 1.5rem !important;
    height: auto !important;
}

.dcc-btn-approve:hover {
    background: #166534 !important;
    border-color: #166534 !important;
}

/* Results table */
.dcc-results-table {
    font-size: 0.82rem;
}

.dcc-results-table th,
.dcc-results-table td {
    padding: 6px 10px;
    vertical-align: middle;
}

.dcc-status-badge {
    display: inline-block;
    padding: 0.15em 0.55em;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dcc-status-success    { background: #dcfce7; color: #166534; }
.dcc-status-partial    { background: #fef9c3; color: #854d0e; }
.dcc-status-error      { background: #fee2e2; color: #991b1b; }
.dcc-status-excluded   { background: #f3f4f6; color: #6b7280; }
.dcc-status-pending    { background: #eff6ff; color: #1e40af; }

/* Settings form */
.dcc-settings {
    max-width: 700px;
}

.dcc-settings .form-table th {
    width: 220px;
}

/* --------------------------------------------------------------------------
   Error detail column & partial-data warning (v1.0.1)
   -------------------------------------------------------------------------- */

.dcc-error-detail {
    font-size: 0.78rem;
    color: #7c3aed;
    max-width: 320px;
    word-break: break-word;
}

.dcc-row-warning td {
    background-color: #fffbeb !important;
}

.dcc-partial-flag {
    color: #d97706;
    font-size: 0.9rem;
    margin-left: 4px;
    cursor: help;
    vertical-align: middle;
}

.dcc-ok {
    color: #9ca3af;
}

/* --------------------------------------------------------------------------
   Errors & Warnings tab (v1.0.2)
   -------------------------------------------------------------------------- */

.dcc-tab-count {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 6px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.6;
}

.dcc-no-errors {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 16px 20px;
    color: #166534;
    font-size: 1rem;
}

.dcc-no-errors .dashicons {
    font-size: 1.4rem;
    color: #16a34a;
}

.dcc-error-summary {
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.dcc-errors-table .col-name     { width: 22%; }
.dcc-errors-table .col-status   { width: 9%; }
.dcc-errors-table .col-error    { width: 35%; }
.dcc-errors-table .col-last-run { width: 10%; }
.dcc-errors-table .col-attempts { width: 7%; }
.dcc-errors-table .col-action   { width: 17%; }

.dcc-edit-link {
    font-size: 0.78rem;
    color: #6b7280;
    text-decoration: none;
}
.dcc-edit-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.dcc-row-fixed td {
    background-color: #f0fdf4 !important;
    opacity: 0.75;
}

.dcc-single-status {
    font-size: 0.8rem;
    margin-left: 6px;
}

/* --------------------------------------------------------------------------
   Inline sitelink editor (v1.0.6)
   -------------------------------------------------------------------------- */

.dcc-errors-table .col-sitelink { width: 22%; }
.dcc-errors-table .col-error    { width: 22%; } /* narrowed to make room */
.dcc-errors-table .col-action   { width: 14%; }

.dcc-sitelink-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dcc-sitelink-input {
    width: 100%;
    font-size: 0.8rem;
    padding: 3px 6px;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    box-sizing: border-box;
}

.dcc-sitelink-input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.dcc-sitelink-input.dcc-url-changed {
    border-color: #d97706;
    background: #fffbeb;
}

.dcc-sitelink-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    min-height: 26px;
}

.dcc-sitelink-status {
    font-size: 0.78rem;
}
