/* ── Remediation Tracker ────────────────────────────────────────────────── */

#remediation-tracker-panel {
    margin-top: 28px;
}

.rem-tracker {
    background: #0f1923;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 12px;
    overflow: hidden;
    font-family: inherit;
}

/* Header */
.rem-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(99, 102, 241, 0.07);
    border-bottom: 1px solid rgba(99, 102, 241, 0.18);
    flex-wrap: wrap;
}

.rem-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rem-icon {
    font-size: 22px;
    color: #818cf8;
    line-height: 1;
}

.rem-title-main {
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.3;
}

.rem-subtitle {
    font-size: 11px;
    color: rgba(226, 232, 240, 0.4);
    margin-top: 2px;
}

.rem-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rem-prog-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 160px;
}

/* Collapse button */
.rem-collapse-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(226, 232, 240, 0.5);
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    padding: 5px 8px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.rem-collapse-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.35);
}

/* Collapsed state — hide body, keep header */
.rem-tracker.rem-collapsed .rem-filters,
.rem-tracker.rem-collapsed .rem-list {
    display: none;
}

/* All-done completion banner */
.rem-all-done {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 20px;
    background: rgba(16, 185, 129, 0.07);
    border-top: 1px solid rgba(16, 185, 129, 0.15);
}
.rem-all-done-icon {
    font-size: 28px;
    color: #10b981;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.rem-all-done-text {
    font-size: 13px;
    color: rgba(226, 232, 240, 0.75);
    line-height: 1.5;
}
.rem-all-done-text strong {
    color: #10b981;
    font-size: 14px;
    display: block;
    margin-bottom: 3px;
}
.rem-all-done-text p {
    margin: 0;
    font-size: 12px;
    color: rgba(226, 232, 240, 0.5);
}

.rem-progress-label {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.55);
}

.rem-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.rem-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 3px;
    transition: width 0.45s ease;
}

/* Filters */
.rem-filters {
    display: flex;
    gap: 6px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

.rem-filter {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 6px;
    color: rgba(226, 232, 240, 0.55);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 11px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.rem-filter:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(226, 232, 240, 0.8);
}

.rem-filter.active {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.45);
    color: #a5b4fc;
}

/* Card list */
.rem-list {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rem-empty,
.rem-loading {
    color: rgba(226, 232, 240, 0.38);
    font-size: 13px;
    text-align: center;
    padding: 28px 16px;
}

/* Action card */
.rem-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-left: 3px solid transparent;
    border-radius: 8px;
    padding: 11px 14px;
    transition: background 0.15s;
}

.rem-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rem-u-critical { border-left-color: #f87171; }
.rem-u-high     { border-left-color: #fb923c; }
.rem-u-medium   { border-left-color: #4ade80; }

.rem-card.rem-done {
    opacity: 0.4;
    border-left-color: rgba(255, 255, 255, 0.12) !important;
}

.rem-card-top {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

/* Urgency badge */
.rem-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.rem-b-critical { background: rgba(248, 113, 113, 0.14); color: #f87171; }
.rem-b-high     { background: rgba(251, 146, 60, 0.14);  color: #fb923c; }
.rem-b-medium   { background: rgba(74, 222, 128, 0.11);  color: #4ade80; }

/* Control ref chip */
.rem-ref {
    font-size: 11px;
    font-weight: 600;
    color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    padding: 2px 6px;
    flex-shrink: 0;
}

/* Card title */
.rem-card-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.4;
    min-width: 0;
}

/* Complete toggle */
.rem-check {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: rgba(255, 255, 255, 0.25);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.rem-check:hover:not(:disabled) {
    border-color: #4ade80;
    color: #4ade80;
}

.rem-check.rem-checked {
    background: rgba(74, 222, 128, 0.13);
    border-color: #4ade80;
    color: #4ade80;
}

.rem-check:disabled { opacity: 0.4; cursor: default; }

/* Detail text */
.rem-detail {
    font-size: 12px;
    color: rgba(226, 232, 240, 0.55);
    line-height: 1.65;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Meta pills */
.rem-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.rem-pill {
    font-size: 11px;
    color: rgba(226, 232, 240, 0.45);
    background: rgba(255, 255, 255, 0.045);
    border-radius: 4px;
    padding: 2px 8px;
}

.rem-pill-score {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
}

/* Responsive */
@media (max-width: 600px) {
    .rem-header { flex-direction: column; align-items: flex-start; }
    .rem-header-right { width: 100%; }
    .rem-prog-wrap { align-items: flex-start; width: 100%; flex: 1; }
}

/* Upgrade notice (shown for trial / no-bundle users) */
.rem-upgrade {
    background: #0f1923;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 12px;
    padding: 36px 28px;
    text-align: center;
    margin-top: 28px;
}

.rem-upgrade-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.rem-upgrade-title {
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 10px;
}

.rem-upgrade-body {
    font-size: 13px;
    color: rgba(226, 232, 240, 0.55);
    line-height: 1.65;
    max-width: 480px;
    margin: 0 auto 20px;
}

.rem-upgrade-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.rem-upgrade-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    transition: transform 0.18s, box-shadow 0.18s;
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.25);
}

.rem-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.38);
}

.rem-upgrade-btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    box-shadow: none;
}

.rem-upgrade-btn-ghost:hover {
    background: rgba(99, 102, 241, 0.12);
    box-shadow: none;
}

/* Upgrade modal overlay */
.rem-upg-overlay {
    position: fixed;
    inset: 0;
    z-index: 10500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: remFadeIn 0.22s ease-out;
}

@keyframes remFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.rem-upg-panel {
    position: relative;
    background: #0e2236;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 14px;
    padding: 38px 32px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    color: #fff;
    font-family: inherit;
}

.rem-upg-panel h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #e2e8f0;
}

.rem-upg-panel p {
    font-size: 13px;
    color: rgba(226, 232, 240, 0.6);
    line-height: 1.65;
    margin-bottom: 22px;
}

.rem-upg-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.rem-upg-close:hover { color: #fff; }

.rem-upg-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Card action buttons (edit / delete / complete) */
.rem-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

.rem-edit-btn,
.rem-delete-btn {
    width: 26px;
    height: 26px;
    border-radius: 5px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s;
}

.rem-card:hover .rem-edit-btn,
.rem-card:hover .rem-delete-btn {
    opacity: 1;
}

.rem-edit-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.rem-delete-btn:hover {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.3);
}

/* Due date pill */
.rem-pill-due {
    color: rgba(196, 181, 253, 0.7);
    background: rgba(99, 102, 241, 0.08);
}

/* Inline edit form */
.rem-edit-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rem-edit-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rem-edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

@media (max-width: 480px) {
    .rem-edit-row { grid-template-columns: 1fr; }
}

.rem-edit-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(226, 232, 240, 0.38);
}

.rem-ef-title,
.rem-ef-detail,
.rem-ef-due,
.rem-ef-assignee {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    padding: 6px 9px;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.rem-ef-title:focus,
.rem-ef-detail:focus,
.rem-ef-due:focus,
.rem-ef-assignee:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.55);
}

.rem-ef-detail {
    resize: vertical;
    min-height: 60px;
    line-height: 1.5;
}

.rem-ef-due {
    color-scheme: dark;
}

.rem-ef-btns {
    display: flex;
    gap: 7px;
    justify-content: flex-end;
    margin-top: 2px;
}

.rem-ef-save,
.rem-ef-cancel {
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.15s, opacity 0.15s;
}

.rem-ef-save {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
}

.rem-ef-save:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
}

.rem-ef-save:disabled {
    opacity: 0.55;
    cursor: default;
}

.rem-ef-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(226, 232, 240, 0.6);
}

.rem-ef-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

/* ── Scenario risk-signal badges ─────────────────────────────────────────── */
/* Duplicated from risk-scenarios.css so the tracker is self-contained on
   pages that do not load that stylesheet (e.g. remediation.html). */

.rs-scenario-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.rs-scenario-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(99, 102, 241, .14);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, .25);
    text-transform: capitalize;
    white-space: nowrap;
}

/* Hide from print */
@media print {
    #remediation-tracker-panel { display: none !important; }
}
