:root {
    /* Brand Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --accent: #8b5cf6;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;

    /* Backgrounds */
    --bg-app: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9;

    /* Text */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    /* Borders */
    --border: #e2e8f0;
    --border-focus: #3b82f6;

    /* CMS-1500 Specific */
    --cms-red: #b91c1c;
    --cms-bg: #fff1f2;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

/* Field Update Animation */
@keyframes fieldPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.field-updated {
    animation: fieldPulse 0.6s ease-in-out 2;
}

/* Green highlight for updated fields */
input.field-updated,
select.field-updated {
    background-color: #dcfce7 !important;
    border-color: #10b981 !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* Layout Shell */
.app-shell {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1e293b;
}

.brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: white;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.main-nav {
    padding: 1rem 0.75rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
}

.nav-item .badge {
    margin-left: auto;
    background-color: var(--danger);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 1rem 1.5rem;
}

.user-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info .user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info .user-role {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    background: white;
    height: 64px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.header-search {
    position: relative;
    width: 400px;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-search input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background-color: var(--bg-app);
    font-size: 0.9rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

.icon-btn .dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

/* Views */
.views-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-app);
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 2rem;
    display: none;
}

.view.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Dashboard */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.metric-title {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.metric-value.warning {
    color: var(--danger);
}

.metric-trend {
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.metric-trend.positive {
    color: var(--success);
}

.metric-trend.negative {
    color: var(--danger);
}

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.chart-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    height: 400px;
}

/* Worklist Table */
.data-table-container {
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.denied {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.approved {
    background: #dcfce7;
    color: #166534;
}

.status-badge.pending {
    background: #fef9c3;
    color: #854d0e;
}

/* CMS-1500 Editor */
.editor-layout {
    display: flex;
    gap: 1.5rem;
    height: 100%;
}

.form-container {
    flex: 1;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    padding: 2rem;
}

.cms-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--cms-red);
    padding-bottom: 1rem;
}

.cms-title {
    color: var(--cms-red);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 1px;
}

.cms-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.cms-section {
    margin-bottom: 1.5rem;
    border: 1px solid var(--cms-red);
    padding: 1rem;
    position: relative;
}

.cms-section label {
    color: var(--cms-red);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
    display: block;
}

.cms-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.col-6 {
    flex: 0 0 50%;
}

.col-3 {
    flex: 0 0 25%;
}

.col-12 {
    flex: 0 0 100%;
}

.cms-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #cbd5e1;
    padding: 0.25rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #334155;
    background: transparent;
}

.cms-input:focus {
    outline: none;
    border-bottom-color: var(--primary);
    background-color: #f0f9ff;
}

.checkbox-group {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    align-items: center;
}

.diagnosis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.diag-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cms-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.cms-table th {
    color: var(--cms-red);
    font-size: 0.65rem;
    text-align: center;
    padding: 0.25rem;
    border: 1px solid var(--cms-red);
}

.cms-table td {
    border: 1px solid var(--cms-red);
    padding: 0;
}

.cms-table input {
    border: none;
    width: 100%;
    padding: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Copilot Sidebar */
.copilot-sidebar {
    width: 400px;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.copilot-header {
    padding: 1rem;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copilot-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copilot-status {
    font-size: 0.7rem;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.copilot-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #f8fafc;
}

.analysis-stream {
    margin-bottom: 1.5rem;
}

.stream-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    animation: slideIn 0.3s ease-out;
}

.stream-item.info i {
    color: var(--info);
}

.stream-item.success i {
    color: var(--success);
}

.copilot-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.timeline-card .timeline-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-step {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
    position: relative;
    transition: border-color 0.3s ease;
}

.timeline-step::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translate(-50%, -50%);
}

.timeline-step.completed {
    border-color: var(--primary);
}

.timeline-step.completed::before {
    background: var(--primary);
}

.timeline-step.active {
    border-color: #f59e0b;
}

.timeline-step.active::before {
    background: #f59e0b;
}

.timeline-step[data-status="pending"] .step-icon {
    opacity: 0.6;
}

.timeline-step[data-status="pending"]::before {
    background: var(--border);
}

.step-panel {
    display: none;
    width: 100%;
}

.step-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.step-panel.open {
    display: block;
    animation: slideIn 0.25s ease;
}

.step-panel .copilot-card {
    width: 100%;
    box-sizing: border-box;
}

.step-card {
    margin-top: 0.75rem;
    width: 100%;
}

.step-card-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.timeline-step.completed .step-icon {
    background: var(--primary);
    color: white;
}

.timeline-step.active .step-icon {
    background: #fbbf24;
    color: #92400e;
}

.step-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.step-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.timeline-status.match {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.timeline-status.warn {
    background: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.timeline-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
}

.timeline-tag.alert {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.timeline-tag.success {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.timeline-tag.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.timeline-detail-content {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
}

.detail-key {
    color: #64748b;
    font-weight: 600;
}

.detail-value {
    color: #0f172a;
    text-align: right;
}

.change-pill {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: #ecfeff;
    border-radius: 999px;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.change-field {
    font-weight: 600;
    color: #0f172a;
}

.change-meta {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    background: #e2e8f0;
    color: #475569;
}

.change-meta.updated {
    background: #e0f2fe;
    color: #0369a1;
}

.change-meta.added {
    background: #dcfce7;
    color: #065f46;
}

.change-meta.removed {
    background: #fee2e2;
    color: #991b1b;
}

.change-meta.automated {
    background: #ede9fe;
    color: #5b21b6;
}

.change-meta.manual {
    background: #fff7ed;
    color: #c2410c;
}

.value-diff {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: stretch;
    margin-bottom: 0.5rem;
}

.value-diff .value {
    background: white;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
}

.value-diff .value-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    display: block;
}

.value-diff .value-content {
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.value-arrow {
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.change-summary {
    font-size: 0.85rem;
    color: #475569;
}

.event-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.event-meta-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.event-meta-value {
    font-weight: 600;
    color: #0f172a;
}

.recent-fixes {
    background: rgba(15, 23, 42, 0.03);
    border-radius: 0.75rem;
    padding: 0.75rem;
}

.recent-fixes-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.4rem;
}

.recent-fix-chip {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.35rem;
}

.recent-fix-chip:last-child {
    margin-bottom: 0;
}

.recent-fix-chip .chip-field {
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f172a;
}

.recent-fix-chip .chip-summary {
    font-size: 0.8rem;
    color: #475569;
}

.detail-text {
    font-size: 0.85rem;
    color: #475569;
    white-space: pre-wrap;
}

.feature-chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.5rem;
}

.feature-summary {
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

.feature-chip {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: #f8fafc;
    animation: popIn 0.3s ease;
}

.feature-chip .chip-label {
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.feature-chip .chip-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.feature-chip .chip-hint {
    font-size: 0.7rem;
    color: #94a3b8;
}

.timeline-risk {
    margin: 0.35rem 0 0;
    padding-left: 1rem;
    color: #475569;
    font-size: 0.75rem;
}

.timeline-controls {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.timeline-btn {
    flex: 1;
    min-width: 120px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    color: #475569;
    cursor: pointer;
    transition: background 0.2s ease;
}

.timeline-btn:hover {
    background: #f1f5f9;
}

.diff-body {
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.4;
}

.diff-body ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.diff-entry {
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.6rem;
    margin-bottom: 0.5rem;
    background: #fff;
}

.diff-entry.final {
    border-color: #10b981;
    background: #ecfdf5;
}

.diff-entry-title {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.diff-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.diff-chip-row .diff-chip {
    font-size: 0.7rem;
}

.diff-note {
    font-size: 0.75rem;
    color: #94a3b8;
}

.diff-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    margin-right: 0.3rem;
}

.diff-chip.up {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.diff-chip.down {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.risk-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.risk-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

.risk-meter {
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.risk-fill {
    height: 100%;
    background: var(--danger);
    transition: width 1s ease;
}

.risk-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--danger);
    margin-bottom: 0.5rem;
}

.risk-reason {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.recommendation-body {
    background: #eff6ff;
    border-radius: 0.5rem;
    padding: 1rem;
}

.shadow-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shadow-history-entry {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.shadow-history-entry:last-child {
    border-bottom: none;
}

.shadow-history-title {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.shadow-history-time {
    font-family: var(--mono, 'JetBrains Mono', monospace);
}

.shadow-rec-card {
    border: 1px dashed var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem;
    background: #f8fafc;
}

.shadow-field {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.shadow-value {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.shadow-evidence {
    font-size: 0.7rem;
    color: #475569;
    margin-top: 0.35rem;
}

.shadow-alignment {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
}

.shadow-alignment.match {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.shadow-alignment.miss {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.badge-light {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
}

.badge-light.warning {
    background: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.shadow-alignment.miss {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.rec-title {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.rec-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.btn-fix {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-fix:hover {
    background: var(--primary-dark);
}

.copilot-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    background: white;
}

.btn-analyze {
    width: 100%;
    background: #1e293b;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-analyze:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

#analyzeBtnWrapper {
    cursor: pointer;
}

#analyzeBtnWrapper:has(button:disabled) {
    cursor: not-allowed;
}

.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modern Form Styling */
.form-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title i {
    color: var(--primary);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.form-input,
.table-input {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.form-input:focus,
.table-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.table-responsive {
    overflow-x: auto;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
}

.service-lines-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.service-lines-table thead {
    background-color: #f8fafc;
}

.service-lines-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Patient Table Styling */
.patient-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.patient-avatar {
    width: 40px;
    height: 40px;
    background-color: #e0e7ff;
    color: #4338ca;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.patient-name {
    font-weight: 600;
    color: var(--text-main);
}

.patient-id {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-red {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-green {
    background-color: #dcfce7;
    color: #166534;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-dot.active {
    background-color: var(--success);
}

.service-lines-table td {
    padding: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.service-lines-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.table-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.total-input {
    font-weight: 700;
    background-color: #f8fafc;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: #fee2e2;
    color: var(--danger);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.total-row td {
    font-weight: 600;
    background-color: #f8fafc;
    border-top: 2px solid var(--border);
}


/* Demo Buttons */
.btn-demo {
    background-color: white;
    color: var(--text-main);
    border: 2px dashed var(--border);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.btn-demo.high {
    border-color: var(--danger);
    color: var(--danger);
}

.btn-demo.high:hover {
    background-color: #fee2e2;
    border-style: solid;
}

.btn-demo.low {
    border-color: var(--success);
    color: var(--success);
}

.btn-demo.low:hover {
    background-color: #dcfce7;
    border-style: solid;
}


/* Demo Notification */
.demo-notification {
    position: fixed;
    top: 80px;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid var(--info);
    max-width: 400px;
}

.demo-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.demo-notification.success {
    border-left-color: var(--success);
    color: var(--success);
}

.demo-notification.warning {
    border-left-color: var(--warning);
    color: var(--warning);
}

.demo-notification i {
    font-size: 1.25rem;
}

.demo-notification span {
    color: var(--text-main);
}


/* Empty State */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    background: white;
    border-radius: 1rem;
    border: 2px dashed var(--border);
    margin-top: 2rem;
}

.empty-state p {
    margin-top: 0.5rem;
}
/* Settings Modal Enhancements */
.setting-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.setting-section:last-of-type {
    border-bottom: none;
}

.setting-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.setting-group {
    margin-bottom: 1.25rem;
}

.setting-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.setting-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.25rem;
}

.setting-group input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-input {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.setting-group select.form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

#resetSettingsBtn {
    margin-right: auto;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.close-modal:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Newly submitted claim highlight animation */
@keyframes pulse-green {
    0%, 100% {
        background-color: #dcfce7;
    }
    50% {
        background-color: #bbf7d0;
    }
}

.newly-submitted-claim {
    animation: pulse-green 2s ease-in-out;
}
