.problems-page {
    --problem-ink: #1e293b;
    --problem-muted: #64748b;
    --problem-border: #e2e8f0;
    --problem-soft: #f8fafc;
    --problem-accent: #0f766e;
}

.problems-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.problems-header h1 { color: var(--problem-ink); margin-bottom: .25rem; }
.problems-header p { color: var(--problem-muted); margin: 0; }
.problem-card {
    background: #fff;
    border: 1px solid var(--problem-border);
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .04);
}
.problem-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--problem-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.problem-card-body { padding: 1.25rem; }
.problem-filters { padding: 1rem 1.25rem; margin-bottom: 1rem; }
.problem-company-quick-find {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-color: #99f6e4;
    background: linear-gradient(135deg, #f0fdfa 0%, #fff 70%);
}
.problem-company-quick-find-copy { min-width: 260px; }
@media (max-width: 767.98px) {
    .problem-company-quick-find { align-items: stretch; flex-direction: column; }
    .problem-company-quick-find-copy { min-width: 0; }
}
.problem-status {
    display: inline-flex;
    align-items: center;
    padding: .25rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
}
.problem-status-open { background: #fee2e2; color: #991b1b; }
.problem-status-investigating { background: #dbeafe; color: #1e40af; }
.problem-status-waiting { background: #fef3c7; color: #92400e; }
.problem-status-resolved { background: #dcfce7; color: #166534; }
.problem-pill {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border: 1px solid var(--problem-border);
    background: var(--problem-soft);
    border-radius: 999px;
    padding: .2rem .55rem;
    color: #475569;
    font-size: .78rem;
}
.problem-title-link { color: var(--problem-ink); font-weight: 700; text-decoration: none; }
.problem-title-link:hover { color: var(--problem-accent); }
.problem-table td { vertical-align: middle; }
.problem-age { font-variant-numeric: tabular-nums; white-space: nowrap; }
.problem-age.is-aging { color: #b45309; font-weight: 700; }
.problem-lookup-results {
    position: absolute;
    z-index: 1080;
    left: 0;
    right: 0;
    top: calc(100% + 3px);
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--problem-border);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .15);
}
.problem-selected-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.problem-selected-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
    border-radius: 999px;
    padding: .2rem .55rem;
    font-size: .82rem;
}
.problem-selected-chip button { border: 0; background: transparent; color: inherit; padding: 0; line-height: 1; }
.problem-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 1.25rem; }
.problem-stack { display: flex; flex-direction: column; gap: 1.25rem; }
.problem-update { display: flex; gap: .75rem; padding: .85rem 0; border-bottom: 1px solid var(--problem-border); }
.problem-update:last-child { border-bottom: 0; }
.problem-avatar {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
    display: grid; place-items: center; background: #ccfbf1; color: #115e59; font-weight: 800;
}
.problem-ticket { padding: .8rem 0; border-bottom: 1px solid var(--problem-border); }
.problem-ticket:last-child { border-bottom: 0; }
.problem-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.problem-metric { padding: 1.1rem; }
.problem-metric-value { font-size: 1.85rem; line-height: 1; font-weight: 800; color: var(--problem-ink); }
.problem-metric-label { margin-top: .45rem; color: var(--problem-muted); font-size: .84rem; }
.problem-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.problem-bar-row { margin-bottom: .9rem; }
.problem-bar-meta { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .3rem; font-size: .87rem; }
.problem-bar-track { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.problem-bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0f766e, #14b8a6); }
.problem-empty { padding: 2rem; text-align: center; color: var(--problem-muted); }
.problem-responsibility-header { align-items: flex-start; }
.problem-responsibility-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.problem-responsibility-chart-card { border: 1px solid var(--problem-border); border-radius: 12px; padding: 1rem; min-width: 0; }
.problem-responsibility-chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; min-height: 48px; }
.problem-responsibility-chart-heading h6 { margin: 0 0 .2rem; color: var(--problem-ink); }
.problem-responsibility-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; margin-top: .2rem; background: #64748b; }
.problem-responsibility-internal .problem-responsibility-dot { background: #0f766e; }
.problem-responsibility-supplier .problem-responsibility-dot { background: #2563eb; }
.problem-responsibility-customer .problem-responsibility-dot { background: #d97706; }
.problem-chart-canvas-wrap { position: relative; height: 320px; margin-top: .75rem; }
.problem-responsibility-matrix-wrap { border-top: 1px solid var(--problem-border); padding-top: 1.25rem; }
.problem-responsibility-matrix th, .problem-responsibility-matrix td { vertical-align: middle; padding: .65rem .75rem; }
.problem-responsibility-matrix td small { display: block; color: var(--problem-muted); font-size: .72rem; }
.problem-responsibility-matrix td.has-problems { border-left: 3px solid transparent; }
.problem-responsibility-matrix td.responsibility-internal { background: #f0fdfa; border-left-color: #0f766e; }
.problem-responsibility-matrix td.responsibility-supplier { background: #eff6ff; border-left-color: #2563eb; }
.problem-responsibility-matrix td.responsibility-customer { background: #fffbeb; border-left-color: #d97706; }
.problem-responsibility-matrix td.responsibility-other { background: #f8fafc; border-left-color: #64748b; }
.problem-responsibility-matrix td.responsibility-total { background: #f8fafc; }
.problem-responsibility-matrix td.responsibility-total small { display: block; color: var(--problem-muted); font-size: .72rem; }
.problem-settings-stack { display: grid; gap: 1.25rem; }
.problem-settings-table th { white-space: nowrap; font-size: .78rem; color: var(--problem-muted); }
.problem-settings-table td { min-width: 90px; }
.problem-settings-table td:first-child { min-width: 240px; }
.problem-causes-table td:nth-child(2) { min-width: 190px; }
.problem-causes-table td:nth-child(3) { min-width: 210px; }
.problem-order-input { width: 76px; min-width: 76px; margin-inline: auto; }
.problem-option-inactive { opacity: .62; background: #f8fafc; }
.problem-option-inactive:focus-within { opacity: 1; }
.problem-settings-add-row { padding: 1rem 1.25rem; border-top: 1px solid var(--problem-border); background: var(--problem-soft); }

@media (max-width: 1100px) {
    .problem-metric-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
    .problem-detail-grid, .problem-overview-grid { grid-template-columns: 1fr; }
    .problem-responsibility-charts { grid-template-columns: 1fr; }
    .problem-chart-canvas-wrap { height: 300px; }
}
@media (max-width: 700px) {
    .problems-header { flex-direction: column; }
    .problem-metric-grid { grid-template-columns: 1fr; }
    .problem-responsibility-header { flex-direction: column; }
}
