* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.auth-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    min-width: 0;
}

.auth-status-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-status-email {
    font-size: 0.95rem;
    color: #1f2937;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.month-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #555;
}

.month-filter input,
.deal-filter input {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    min-width: 150px;
}

.deal-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #555;
}

.more-actions {
    position: relative;
}

.more-actions summary {
    list-style: none;
}

.more-actions summary::-webkit-details-marker {
    display: none;
}

.more-trigger {
    width: 42px;
    min-width: 42px;
    padding: 8px 0;
    font-size: 1.25rem;
    line-height: 1;
    text-align: center;
}

.more-actions-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 190px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.more-actions-menu .btn {
    width: 100%;
    text-align: left;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.timestamp {
    margin-left: auto;
    color: #666;
    font-size: 0.9rem;
}

.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-shell {
    width: 100%;
    max-width: 520px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 24px 60px rgba(31, 41, 55, 0.16);
    backdrop-filter: blur(10px);
}

.auth-card-header {
    margin-bottom: 24px;
}

.auth-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 10px;
}

.auth-copy {
    color: #4b5563;
    line-height: 1.6;
    margin-top: 12px;
}

.auth-domains {
    margin-top: 14px;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 600;
}

.auth-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.auth-field {
    display: grid;
    gap: 6px;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
}

.auth-field input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.16);
}

.auth-submit,
.auth-secondary {
    width: 100%;
}

.auth-message {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.auth-message.info {
    background: #eff6ff;
    color: #1d4ed8;
}

.auth-message.success {
    background: #ecfdf5;
    color: #047857;
}

.auth-message.error {
    background: #fef2f2;
    color: #b91c1c;
}

.automation-toolbar {
    margin-bottom: 28px;
}

.automation-note {
    color: #475569;
    margin-top: -10px;
}

.automation-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 20px;
}

.automation-panel {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
}

.automation-detail-panel {
    min-height: 420px;
}

.automation-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.automation-panel-header h2 {
    font-size: 1.2rem;
}

.automation-status-text {
    color: #64748b;
    font-size: 0.9rem;
}

.automation-runs-list,
.automation-actions-list {
    display: grid;
    gap: 12px;
}

.automation-run-card {
    width: 100%;
    border: 1px solid #dbe4f0;
    background: white;
    border-radius: 12px;
    padding: 14px;
    text-align: left;
    cursor: pointer;
}

.automation-run-card.is-selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.14);
}

.automation-run-card-top,
.automation-run-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.automation-run-card-top {
    margin-bottom: 8px;
}

.automation-run-id {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.9rem;
}

.automation-run-status,
.automation-action-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-running {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-completed,
.status-planned {
    background: #dcfce7;
    color: #166534;
}

.status-blocked {
    background: #fee2e2;
    color: #b91c1c;
}

.status-manual_review {
    background: #fef3c7;
    color: #92400e;
}

.status-skipped {
    background: #fef3c7;
    color: #92400e;
}

.status-cancelling {
    background: #ffedd5;
    color: #9a3412;
}

.status-failed {
    background: #fee2e2;
    color: #b91c1c;
}

.automation-run-meta,
.automation-run-scope {
    color: #475569;
    font-size: 0.88rem;
}

.automation-run-scope {
    margin-top: 8px;
}

.automation-progress {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.automation-progress-compact {
    margin-top: 10px;
}

.automation-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
    color: #475569;
}

.automation-progress-track {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.automation-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
    transition: width 0.3s ease;
}

.automation-progress-current {
    font-size: 0.85rem;
    color: #1e293b;
    overflow-wrap: anywhere;
}

.automation-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.automation-detail-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.automation-detail-grid > div {
    display: grid;
    gap: 2px;
    padding: 12px;
    border-radius: 12px;
    background: white;
    border: 1px solid #e2e8f0;
}

.automation-detail-label {
    color: #64748b;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.automation-detail-error {
    color: #b91c1c;
    margin-bottom: 14px;
}

.automation-action-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    padding: 14px;
}

.automation-action-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.automation-action-card summary::-webkit-details-marker {
    display: none;
}

.automation-action-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.automation-action-type {
    font-weight: 700;
    color: #0f172a;
}

.automation-action-deal {
    color: #475569;
    font-size: 0.9rem;
}

.automation-action-body {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fee;
    border-left: 4px solid #f44336;
    padding: 20px;
    margin: 20px 0;
    border-radius: 6px;
    color: #c62828;
}

.summary {
    margin-bottom: 30px;
}

.summary h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-card.alert {
    border-left-color: #f44336;
    background: #ffebee;
}

.summary-card.warning {
    border-left-color: #ff9800;
    background: #fff3e0;
}

.summary-card.info {
    border-left-color: #2196f3;
    background: #e3f2fd;
}

.summary-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.filters {
    margin-bottom: 30px;
    padding: 22px;
    background: linear-gradient(180deg, #fbfcfe, #f4f7fb);
    border: 1px solid #dde6f2;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.info-panel {
    margin-bottom: 24px;
    padding: 18px;
    border: 1px solid #dfe4ea;
    border-radius: 8px;
    background: #f9fbff;
}

.info-panel h3 {
    margin-bottom: 10px;
}

.info-panel p {
    margin-bottom: 12px;
    color: #555;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.info-panel h4 {
    margin-bottom: 8px;
}

.info-panel ul {
    margin-left: 18px;
    color: #444;
}

.info-panel li {
    margin-bottom: 6px;
}

.filters h3 {
    margin-bottom: 4px;
    color: #20324d;
}

.filters-header {
    margin-bottom: 16px;
}

.filters-header p {
    color: #61738d;
    font-size: 0.92rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
}

.filter-panel-title {
    color: #61738d;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.filter-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 14px 0 10px;
    border: 1px solid #d3deea;
    border-radius: 999px;
    background: #f8fbfe;
    color: #385677;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-chip-toggle {
    position: relative;
    width: 28px;
    height: 16px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(48, 70, 95, 0.18);
    transition: all 0.2s ease;
}

.filter-chip-toggle::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
    transition: transform 0.2s ease;
}

.filter-chip:has(input:checked) .filter-chip-toggle::after {
    transform: translateX(12px);
}

.filter-chip:has(input:not(:checked)) {
    background: #eef2f6;
    border-color: #d7dde5;
    color: #7c8796;
}

.filter-chip:has(input:not(:checked)) .filter-chip-toggle {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(124, 135, 150, 0.22);
}

.filter-chip.severity-high {
    background: #fdeceb;
    border-color: #efb0aa;
    color: #a12d21;
}

.filter-chip.severity-medium {
    background: #fff4db;
    border-color: #e8c56a;
    color: #8a5a00;
}

.filter-chip.severity-low {
    background: #edf5ff;
    border-color: #aac6ef;
    color: #1f4f8f;
}

.filter-chip.issue-brightspace {
    background: #fff0f0;
    border-color: #efc0c0;
    color: #9f3030;
}

.filter-chip.issue-entitlements {
    background: #fff1f5;
    border-color: #edbfd1;
    color: #9b335a;
}

.filter-chip.issue-mismatch {
    background: #eef7ff;
    border-color: #bed7f5;
    color: #28588b;
}

.filter-chip.issue-overdue {
    background: #fff4db;
    border-color: #e8c56a;
    color: #8a5a00;
}

.filter-chip.issue-duplicates {
    background: #f4f0ff;
    border-color: #d3c1fb;
    color: #5c3f9f;
}

.results h2 {
    margin-bottom: 20px;
    color: #333;
}

.discrepancy-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.discrepancy-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.discrepancy-header {
    display: block;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.discrepancy-title {
    min-width: 0;
}

.recheck-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 220px;
}

.recheck-controls-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.recheck-source {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #c9d4e2;
    border-radius: 999px;
    background: #fff;
    color: #30465f;
    font-size: 0.86rem;
}

.recheck-status {
    color: #5f7187;
    font-size: 0.78rem;
    min-height: 16px;
    text-align: right;
}

.recheck-btn {
    width: 100%;
}

.recheck-btn-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 88px;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 0.84rem;
}

.deal-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.deal-title-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.discrepancy-title h3 {
    color: #20324d;
    margin-bottom: 0;
}

.deal-title-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f7fb;
    border: 1px solid #d3deea;
    color: #426181;
    font-size: 0.82rem;
    font-weight: 600;
}

.deal-title-meta a {
    color: inherit;
    text-decoration: none;
}

.deal-title-meta a:hover {
    text-decoration: underline;
}

.deal-title-label {
    color: #6a7e97;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.days-overdue-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 700;
}

.days-overdue-pill.is-overdue {
    background: #fdeceb;
    border-color: #f3b2ac;
    color: #b42318;
}

.days-overdue-pill.is-current {
    background: #ecfdf3;
    border-color: #abe3c0;
    color: #067647;
}

.days-overdue-pill-label {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.discrepancy-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.meta-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid #dde6f2;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(241, 246, 252, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.meta-panel-wide {
    grid-column: span 2;
}

.meta-panel-identity {
    background:
        linear-gradient(135deg, rgba(230, 241, 255, 0.96), rgba(244, 249, 255, 0.96));
    border-color: #c9daf0;
}

.meta-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #61738d;
}

.meta-kicker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.meta-value {
    color: #20324d;
    font-size: 0.95rem;
    font-weight: 600;
}

.meta-value a {
    color: #264f86;
    text-decoration: none;
}

.meta-value a:hover {
    text-decoration: underline;
}

.identity-name {
    color: #20324d;
    font-size: 1rem;
    font-weight: 700;
}

.identity-heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.identity-email,
.identity-email a {
    color: #47627f;
    font-size: 0.92rem;
    text-decoration: none;
}

.identity-email a:hover {
    text-decoration: underline;
}

.meta-inline-label {
    color: #61738d;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.identity-id {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #365a82;
    font-size: 0.82rem;
    font-weight: 600;
}

.identity-id-value a {
    color: inherit;
    text-decoration: none;
}

.identity-id-value a:hover {
    text-decoration: underline;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.empty-state-inline {
    color: #7a8798;
    font-size: 0.88rem;
}

.enrollment-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 2px 6px 2px 0;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.enrollment-pill a {
    color: inherit;
    text-decoration: none;
}

.enrollment-pill a:hover {
    text-decoration: underline;
}

.enrollment-pill-access {
    padding-left: 8px;
    border-left: 1px solid rgba(0, 0, 0, 0.14);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.enrollment-pill.is-active {
    background: #e8f7ee;
    border-color: #94d3a2;
    color: #1e6b34;
}

.enrollment-pill.is-inactive {
    background: #fdeceb;
    border-color: #efb0aa;
    color: #a12d21;
}

.enrollment-pill.is-expired {
    background: #fff5e6;
    border-color: #f0ca7a;
    color: #8a5a00;
}

.enrollment-pill.is-revoked {
    background: #fbe9ef;
    border-color: #e0a9bd;
    color: #8d2146;
}

.enrollment-pill.is-hidden {
    background: #eef1f4;
    border-color: #c9d1d9;
    color: #4b5563;
}

.enrollment-pill.is-pending {
    background: #fff4db;
    border-color: #e8c56a;
    color: #8a5a00;
}

.enrollment-pill.is-failed {
    background: #fde7e7;
    border-color: #e59b9b;
    color: #8b1e1e;
}

.enrollment-pill.is-other {
    background: #edf5ff;
    border-color: #aac6ef;
    color: #1f4f8f;
}

.enrollment-pill.is-unknown {
    background: #f1f3f5;
    border-color: #cfd4da;
    color: #495057;
}

.link-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #cfdae8;
    background: #f7fafd;
    color: #35557d;
    font-size: 0.82rem;
    font-weight: 600;
}

.link-pill a {
    color: inherit;
    text-decoration: none;
}

.link-pill a:hover {
    text-decoration: underline;
}

.link-pill.neutral {
    background: #f3f7fb;
    border-color: #d3deea;
    color: #426181;
}

.course-section-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #c7d7ef;
    background: linear-gradient(180deg, #f6faff, #edf4ff);
    color: #21456d;
    font-size: 0.83rem;
    font-weight: 600;
}

.course-section-pill-part {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.course-section-pill-label {
    color: #67809f;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.course-section-pill a {
    color: #21456d;
    text-decoration: none;
}

.course-section-pill a:hover {
    text-decoration: underline;
}

.course-section-pill-divider {
    width: 1px;
    height: 18px;
    background: rgba(62, 95, 133, 0.18);
}

.brightspace-enrollment-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #bbd8c0;
    background: linear-gradient(180deg, #f4fcf5, #e9f8ec);
    color: #24553a;
    font-size: 0.83rem;
    font-weight: 600;
}

.brightspace-enrollment-pill-part {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.brightspace-enrollment-pill-label {
    color: #5d7f68;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brightspace-enrollment-pill a {
    color: inherit;
    text-decoration: none;
}

.brightspace-enrollment-pill a:hover {
    text-decoration: underline;
}

.brightspace-enrollment-pill-divider {
    width: 1px;
    height: 18px;
    background: rgba(36, 85, 58, 0.16);
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: #4f6fcf;
    vertical-align: text-bottom;
}

.icon-link:hover {
    color: #3451a5;
}

.icon-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.meta-label {
    font-weight: 600;
}

.issues-list {
    margin-bottom: 15px;
}

.issue-item {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: #f8f9fa;
}

.issue-item.high {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.issue-item.medium {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.issue-item.low {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.severity-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.severity-badge.high {
    background: #f44336;
    color: white;
}

.severity-badge.medium {
    background: #ff9800;
    color: white;
}

.severity-badge.low {
    background: #2196f3;
    color: white;
}

.systems-status {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.system-card {
    padding: 15px;
    border-radius: 6px;
    background: #f8f9fa;
}

.system-card.exists {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.system-card.missing {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.system-name {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.system-status {
    font-size: 0.9rem;
    color: #666;
}

.system-pill-block {
    margin-top: 12px;
}

.system-pill-label {
    display: inline-block;
    margin-bottom: 8px;
    color: #61738d;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.system-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.payload-copy-status {
    font-size: 0.85rem;
    color: #555;
}

.payload-preview {
    margin-top: 12px;
}

.payload-preview summary {
    cursor: pointer;
    color: #333;
    font-weight: 600;
}

.payload-preview pre {
    margin-top: 8px;
    padding: 12px;
    overflow-x: auto;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #333;
    font-size: 0.85rem;
    line-height: 1.45;
}

.status-icon {
    font-size: 1.2rem;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results h2 {
    color: #4caf50;
    margin-bottom: 15px;
}

.no-results p {
    color: #666;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    body {
        padding: 14px;
    }

    .container {
        padding: 20px;
    }

    .header-main,
    .header-actions {
        align-items: stretch;
    }

    .header-main {
        flex-direction: column;
    }

    .auth-status {
        align-items: flex-start;
    }

    .auth-card {
        padding: 24px;
    }

    .automation-layout {
        grid-template-columns: 1fr;
    }

    .automation-detail-grid {
        grid-template-columns: 1fr;
    }

    .automation-detail-actions {
        justify-content: stretch;
    }

    .automation-detail-actions .btn {
        width: 100%;
    }

    .header-main {
        flex-direction: column;
        align-items: flex-start;
    }

    h1 {
        font-size: 1.8rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .discrepancy-header {
        gap: 12px;
    }

    .recheck-controls {
        width: 100%;
        align-items: stretch;
        min-width: 0;
    }

    .recheck-controls-main {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .deal-title-row {
        flex-direction: column;
        align-items: stretch;
    }

    .meta-kicker-row {
        align-items: flex-start;
    }

    .systems-status {
        grid-template-columns: 1fr;
    }

    .discrepancy-meta-grid {
        grid-template-columns: 1fr;
    }

    .meta-panel-wide {
        grid-column: span 1;
    }

    .course-section-pill {
        width: 100%;
        border-radius: 16px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .brightspace-enrollment-pill {
        width: 100%;
        border-radius: 16px;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }
}
