/* ══════════════════════════════════════════════════════════════════════
   CRAFT MONITOR — DESIGN SYSTEM
   Bootstrap 5 overrides + cm-* custom components
   ══════════════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ─────────────────────────────────────────────────── */
:root {
    /* Bootstrap variable overrides */
    --bs-link-color:       #0075BC;
    --bs-link-hover-color: #005f97;
    --bs-body-font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --bs-body-font-size:   .875rem;
    --bs-body-color:       #111827;
    --bs-body-bg:          #f7f8fa;

    /* Custom tokens */
    --cm-primary:         #0075BC;
    --cm-primary-dark:    #005f97;
    --cm-primary-darker:  #004f7d;
    --cm-primary-light:   #cce3f3;
    --cm-primary-subtle:  #e6f2fa;
    --cm-amber:           #F08A1E;
    --cm-amber-dark:      #d47718;
    --cm-amber-light:     #fde8cc;
    --cm-amber-subtle:    #fef5ea;
    --cm-border:          #e5e7eb;
    --cm-border-subtle:   rgba(0,0,0,.06);
    --cm-text-secondary:  #374151;
    --cm-text-muted:      #6b7280;
    --cm-text-faint:      #9ca3af;
    --cm-sidebar-bg:      #0d1b2a;
    --cm-sidebar-width:   232px;
}

/* ── BASE ──────────────────────────────────────────────────────────── */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── BOOTSTRAP 5 COMPONENT OVERRIDES ──────────────────────────────── */

/* Table */
.table > :not(caption) > * > * {
    padding: .75rem 1rem;
}
.table thead th {
    font-size: .6875rem !important;
    font-weight: 600 !important;
    letter-spacing: .055em;
    text-transform: uppercase;
    color: #a1a1aa;
    white-space: nowrap;
}
.table-sm > :not(caption) > * > * {
    padding: .4rem .75rem;
}
.table-sm thead th {
    font-size: .625rem !important;
}

/* Card */
.card {
    border-color: rgba(0,0,0,.07);
    border-radius: 8px;
}
.card-header {
    background-color: #fff;
    border-bottom-color: rgba(0,0,0,.06);
    padding: .75rem 1.25rem;
    font-size: .875rem;
}
.card-footer {
    background-color: #fafafa;
    border-top-color: rgba(0,0,0,.05);
    font-size: .8125rem;
    color: #9ca3af;
}
.shadow-sm {
    box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.04) !important;
}

/* Buttons */
.btn {
    font-size: .8125rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all .12s ease;
    letter-spacing: -.005em;
}
.btn-sm {
    font-size: .75rem;
    padding: .3125rem .75rem;
    border-radius: 5px;
}
.btn-primary {
    background-color: #0075BC;
    border-color: #0075BC;
    box-shadow: 0 1px 2px rgba(0,117,188,.2);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #006aab;
    border-color: #006aab;
}
.btn-outline-secondary {
    color: #374151;
    border-color: #e2e4e9;
    background-color: #fff;
}
.btn-outline-secondary:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}
.btn-outline-primary {
    color: #0075BC;
    border-color: #b8d9f0;
    background-color: #fff;
}
.btn-outline-primary:hover {
    background-color: #f0f8ff;
    border-color: #0075BC;
    color: #0075BC;
}
.btn-outline-danger { border-color: #fca5a5; }
.btn-secondary { background-color: #F08A1E; border-color: #F08A1E; }
.btn-secondary:hover { background-color: #d47718; border-color: #d47718; }

/* Forms */
.form-control, .form-select {
    font-size: .875rem;
    border-color: #d4d4d8;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
    transition: border-color .12s, box-shadow .12s;
}
.form-control:focus, .form-select:focus {
    border-color: #0075BC;
    box-shadow: 0 0 0 3px rgba(0,117,188,.1);
}
.form-label {
    font-size: .8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: .3125rem;
}
.form-text      { color: #9ca3af; font-size: .75rem; }
.invalid-feedback { font-size: .75rem; }

/* Breadcrumb */
.breadcrumb {
    font-size: .8125rem;
    --bs-breadcrumb-item-active-color: #374151;
}
.breadcrumb-item a { color: #71717a; text-decoration: none; }
.breadcrumb-item a:hover { color: #111827; }
.breadcrumb-item + .breadcrumb-item::before { color: #d4d4d8; }

/* Alert */
.alert { font-size: .875rem; border-radius: 8px; }

/* Badge */
.badge { font-weight: 500; border-radius: 5px; }

/* ── LAYOUT UTILITIES (Bootstrap 5 missing) ────────────────────────── */
.d-contents { display: contents; }
.min-w-0    { min-width: 0; }

/* ── PAGE CONTENT WRAPPER ──────────────────────────────────────────── */
.cm-content { padding: 2rem 2.5rem; flex: 1 1 auto; }

/* ── SIDEBAR ────────────────────────────────────────────────────────── */
.cm-sidebar {
    width: var(--cm-sidebar-width);
    background-color: var(--cm-sidebar-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.cm-sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.125rem 1.375rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.07);
    text-decoration: none;
}
.cm-sidebar-brand img {
    width: 100%;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: .9;
}
.cm-nav-section {
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.25);
    padding: 1.25rem 1.375rem .35rem;
}
.cm-nav-link {
    color: rgba(255,255,255,.55);
    padding: .45rem 1.375rem;
    font-size: .8125rem;
    font-weight: 450;
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    transition: background .12s, color .12s;
    margin: 1px 0;
}
.cm-nav-link:hover {
    color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.06);
}
.cm-nav-link.active {
    color: #fff;
    background: rgba(0,117,188,.25);
    border-left: 2px solid #3b9fd6;
    padding-left: calc(1.375rem - 2px);
    font-weight: 500;
}
.cm-nav-link .nav-icon {
    font-size: .9rem;
    width: 1.15rem;
    text-align: center;
    flex-shrink: 0;
    opacity: .7;
}
.cm-nav-link.active .nav-icon { opacity: 1; }

/* ── TOPBAR ─────────────────────────────────────────────────────────── */
.cm-topbar {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.06);
    padding: 0 2rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
    flex-shrink: 0;
    font-size: .75rem;
    color: #9ca3af;
}
.cm-topbar a {
    color: #9ca3af;
    text-decoration: none;
    transition: color .12s;
}
.cm-topbar a:hover { color: #374151; }

/* ══════════════════════════════════════════════════════════════════════
   CRAFT MONITOR — BADGE SYSTEM
   ══════════════════════════════════════════════════════════════════════ */

/* ── Badge base ─────────────────────────────────────────────────────── */
.cm-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: .6875rem;
    font-weight: 500;
    border: 1px solid transparent;
    white-space: nowrap;
    vertical-align: middle;
    line-height: 1.5;
    text-decoration: none;
    letter-spacing: .005em;
}
.cm-badge--lg { font-size: .8125rem; padding: 4px 12px; }
.cm-dot {
    display: inline-block;
    width: 5.5px;
    height: 5.5px;
    border-radius: 50%;
    flex-shrink: 0;
}
.cm-badge--lg .cm-dot { width: 7px; height: 7px; }

/* ── Lifecycle status ───────────────────────────────────────────────── */
.cm-lc--active         { background: #f0fdf4; color: #166534; border-color: #d1fae5; }
.cm-lc--active         .cm-dot { background: #22c55e; }
.cm-lc--maintenance    { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.cm-lc--maintenance    .cm-dot { background: #f59e0b; }
.cm-lc--sla_only       { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.cm-lc--sla_only       .cm-dot { background: #3b82f6; }
.cm-lc--paused         { background: #fafafa; color: #52525b; border-color: #e4e4e7; }
.cm-lc--paused         .cm-dot { background: #a1a1aa; }
.cm-lc--decommissioned { background: #fef2f2; color: #991b1b; border-color: #fee2e2; }
.cm-lc--decommissioned .cm-dot { background: #ef4444; }
.cm-lc--handover       { background: var(--cm-primary-subtle); color: var(--cm-primary-dark); border-color: var(--cm-primary-light); }
.cm-lc--handover       .cm-dot { background: var(--cm-primary); }

/* ── Sync status ────────────────────────────────────────────────────── */
.cm-sync--ok      { background: #f0fdf4; color: #166534; border-color: #d1fae5; }
.cm-sync--ok      .cm-dot { background: #22c55e; }
.cm-sync--error   { background: #fef2f2; color: #991b1b; border-color: #fee2e2; }
.cm-sync--error   .cm-dot { background: #ef4444; }
.cm-sync--pending { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.cm-sync--pending .cm-dot { background: #f59e0b; }
.cm-sync--never   { background: #fafafa; color: #71717a; border-color: #e4e4e7; }
.cm-sync--never   .cm-dot { background: #a1a1aa; }

/* ── Update severity chips ──────────────────────────────────────────── */
.cm-chip {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .015em;
    border: 1px solid transparent;
    white-space: nowrap;
    vertical-align: middle;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.cm-chip--patch { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.cm-chip--minor { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.cm-chip--major { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }

/* ── Upgrade difficulty badge ───────────────────────────────────────── */
.cm-difficulty {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 4px;
    font-size: .68rem; font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap; vertical-align: middle;
}
.cm-difficulty--easy      { background: #ecfdf5; color: #15803d; border-color: #bbf7d0; }
.cm-difficulty--medium    { background: #fefce8; color: #854d0e; border-color: #fde68a; }
.cm-difficulty--hard      { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.cm-difficulty--very-hard { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ── Notice boxes ───────────────────────────────────────────────────── */
.cm-notice {
    display: flex; gap: .75rem;
    padding: .875rem 1.125rem;
    border-radius: 8px; border: 1px solid transparent;
    font-size: .875rem; line-height: 1.55;
}
.cm-notice__icon  { flex-shrink: 0; font-size: .9375rem; margin-top: .125rem; }
.cm-notice__body  { flex: 1; min-width: 0; }
.cm-notice__title { font-weight: 600; margin-bottom: .25rem; font-size: .875rem; }
.cm-notice--error   { background: #fef2f2; color: #991b1b; border-color: #fee2e2; }
.cm-notice--warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.cm-notice--info    { background: #eff6ff; color: #1e40af; border-color: #dbeafe; }
.cm-notice--success { background: #f0fdf4; color: #166534; border-color: #d1fae5; }

/* ── Empty states ───────────────────────────────────────────────────── */
.cm-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 3.5rem 2rem; text-align: center;
}
.cm-empty__icon { font-size: 1.75rem; color: #d4d4d8; margin-bottom: .875rem; line-height: 1; }
.cm-empty__text { color: #71717a; font-size: .875rem; margin: 0 0 1.125rem; line-height: 1.55; }
.cm-empty__text:last-child { margin-bottom: 0; }

/* ── Project health table ───────────────────────────────────────────── */
.cm-project-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
.cm-project-table thead tr { background: #fafafa; }
.cm-project-table thead th {
    padding: .625rem 1rem;
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #a1a1aa;
    border-bottom: 1px solid rgba(0,0,0,.06);
    white-space: nowrap;
}
.cm-project-table tbody tr {
    border-bottom: 1px solid rgba(0,0,0,.04);
    transition: background .1s ease;
}
.cm-project-table tbody td { padding: .8125rem 1rem; }
.cm-project-table tbody tr:last-child { border-bottom: none; }
.cm-project-table tbody tr:hover      { background: rgba(0,117,188,.022) !important; }
.cm-project-table tbody tr.cm-row--error { background: rgba(254,242,242,.5); }
.cm-project-table tbody tr.cm-row--warn  { background: rgba(255,251,235,.5); }
.cm-project-table tbody tr.cm-row--error:hover { background: rgba(254,242,242,.8) !important; }
.cm-project-table tbody tr.cm-row--warn:hover  { background: rgba(255,251,235,.8) !important; }

/* ── Quick action links ─────────────────────────────────────────────── */
.cm-quick-link {
    display: flex; align-items: center; gap: .625rem;
    padding: .5rem .625rem; border-radius: 7px;
    color: #52525b; text-decoration: none;
    font-size: .8125rem;
    transition: background .12s, color .12s; line-height: 1.4;
}
.cm-quick-link:hover { background: #f4f4f5; color: #111827; }
.cm-quick-link .cm-ql-icon {
    display: flex; align-items: center; justify-content: center;
    width: 1.625rem; height: 1.625rem; border-radius: 5px;
    background: #f4f4f5; border: 1px solid rgba(0,0,0,.06);
    flex-shrink: 0; font-size: .75rem; color: #71717a;
    transition: background .12s;
}
.cm-quick-link:hover .cm-ql-icon { background: #e4e4e7; color: #374151; }

/* ── Sync feed items ────────────────────────────────────────────────── */
.cm-sync-feed-item {
    padding: .6875rem 1.125rem;
    border-left: 2px solid transparent;
    border-bottom: 1px solid rgba(0,0,0,.04);
    transition: background .1s;
}
.cm-sync-feed-item:last-child { border-bottom: none; }
.cm-sync-feed-item:hover      { background: #f9fafb; }
.cm-sync-feed-item--ok        { border-left-color: #22c55e; }
.cm-sync-feed-item--error     { border-left-color: #ef4444; background: rgba(254,242,242,.2); }
.cm-sync-feed-item--pending   { border-left-color: #f59e0b; }
.cm-sync-feed-item--never     { border-left-color: #e4e4e7; }
.cm-sync-feed-item--error:hover { background: rgba(254,242,242,.45); }

/* ── Expandable plugin list ─────────────────────────────────────────── */
[aria-expanded="false"] .when-expanded { display: none; }
[aria-expanded="true"]  .when-collapsed { display: none; }

/* ══════════════════════════════════════════════════════════════════════
   DASHBOARD v3 — refined hierarchy, spacing, and visual weight
   ══════════════════════════════════════════════════════════════════════ */

/* ── Dashboard layout ──────────────────────────────────────────────── */
.cm-dashboard { max-width: 1440px; }
.cm-section          { margin-bottom: 1.75rem; }
.cm-section--primary { margin-bottom: 2rem; }
.cm-section--flush   { margin-bottom: 1.25rem; }
.cm-section--main    { margin-bottom: 2.5rem; }
.cm-section--secondary { margin-bottom: 0; }

/* ── Dashboard header ──────────────────────────────────────────────── */
.cm-dash-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: .75rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--cm-border);
}
.cm-dash-header__title {
    font-size: 1.35rem; font-weight: 700; color: #111827;
    letter-spacing: -.03em; margin: 0 0 .125rem; line-height: 1.2;
}
.cm-dash-header__date {
    font-size: .78rem; color: var(--cm-text-faint); margin: 0;
}
.cm-dash-header__actions {
    display: flex; gap: .5rem; align-items: center;
}

/* ── Avatar ────────────────────────────────────────────────────────── */
.cm-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; flex-shrink: 0; object-fit: cover;
}
.cm-avatar--initials {
    background: #e5e7eb; color: #4b5563;
    font-weight: 600; text-transform: uppercase; letter-spacing: .01em;
}

/* ── KPI row (personal) ────────────────────────────────────────────── */
.cm-kpi-row {
    display: flex; align-items: stretch; gap: .75rem;
    margin-bottom: 1.25rem; flex-wrap: wrap;
}
.cm-kpi {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: .75rem 1.25rem; min-width: 5rem;
    background: #fff; border: 1px solid var(--cm-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.cm-kpi__value {
    font-size: 1.5rem; font-weight: 800; color: #111827;
    line-height: 1; letter-spacing: -.03em;
}
.cm-kpi__label {
    font-size: .6rem; color: var(--cm-text-faint);
    text-transform: uppercase; letter-spacing: .07em;
    font-weight: 600; margin-top: .3rem; white-space: nowrap;
}
.cm-kpi--danger  { border-color: #fecaca; background: #fffbfb; }
.cm-kpi--danger  .cm-kpi__value { color: #dc2626; }
.cm-kpi--warning { border-color: #fde68a; background: #fffdf7; }
.cm-kpi--warning .cm-kpi__value { color: #d97706; }
.cm-kpi--amber   { border-color: #fed7aa; background: #fff7ed; }
.cm-kpi--amber   .cm-kpi__value { color: #ea580c; }

/* ── Attention list (personal) ─────────────────────────────────────── */
.cm-attention {
    border: 1px solid #fecaca; border-radius: 8px;
    background: #fffbfb; overflow: hidden;
}
.cm-attention__header {
    display: flex; align-items: center; gap: .5rem;
    padding: .625rem 1rem; font-size: .78rem; font-weight: 600;
    color: #991b1b; background: rgba(254,226,226,.25);
    border-bottom: 1px solid #fecaca;
}
.cm-attention__header i { font-size: .75rem; }
.cm-attention__item {
    display: flex; align-items: center; gap: .5rem;
    padding: .45rem 1rem; text-decoration: none; color: inherit;
    font-size: .78rem; border-bottom: 1px solid rgba(0,0,0,.03);
    transition: background .1s;
}
.cm-attention__item:last-of-type { border-bottom: none; }
.cm-attention__item:hover { background: rgba(254,226,226,.15); }
.cm-attention__project { font-weight: 600; color: #111827; white-space: nowrap; }
.cm-attention__msg     { color: var(--cm-text-muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-attention__arrow   { color: #d1d5db; font-size: .55rem; flex-shrink: 0; margin-left: auto; }
.cm-attention__overflow {
    padding: .35rem 1rem; font-size: .68rem; color: var(--cm-text-faint);
    text-align: center; background: rgba(0,0,0,.012);
}

/* ── Attention badge (shared) ──────────────────────────────────────── */
.cm-attn-badge {
    font-size: .55rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; padding: 2px 6px; border-radius: 3px;
    flex-shrink: 0; line-height: 1.4; text-align: center; min-width: 2.8rem;
}
.cm-attn-badge--danger    { background: #fee2e2; color: #991b1b; }
.cm-attn-badge--warning   { background: #fef3c7; color: #92400e; }
.cm-attn-badge--secondary { background: #f3f4f6; color: #6b7280; }

/* ── Pill (count) ──────────────────────────────────────────────────── */
.cm-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem;
    border-radius: 100px; font-size: .575rem; font-weight: 700;
    color: #fff; margin-left: auto;
}
.cm-pill--danger  { background: #dc2626; }
.cm-pill--warning { background: #d97706; }

/* ── Health strip (global, compact) ────────────────────────────────── */
.cm-health-strip {
    display: flex; gap: 1px; background: rgba(0,0,0,.06);
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.cm-health-strip__item {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    padding: .625rem .375rem; background: #fff; min-width: 0;
}
.cm-health-strip__value {
    font-size: 1.2rem; font-weight: 700; color: #111827;
    line-height: 1; letter-spacing: -.02em;
}
.cm-health-strip__value--alert { font-weight: 800; }
.cm-health-strip__label {
    font-size: .55rem; color: var(--cm-text-faint);
    text-transform: uppercase; letter-spacing: .07em;
    font-weight: 600; margin-top: .25rem; text-align: center;
}
.cm-health-strip__sub {
    font-size: .62rem; color: var(--cm-text-faint); margin-top: .1rem;
}
.cm-health-strip__sub--alert { color: #dc2626; font-weight: 600; }

/* ── System alert (global attention) ───────────────────────────────── */
.cm-system-alert {
    border-radius: 8px; overflow: hidden; border: 1px solid transparent;
}
.cm-system-alert--error { border-color: #fecaca; background: #fffbfb; }
.cm-system-alert--warn  { border-color: #fde68a; background: #fffdf7; }
.cm-system-alert__header {
    display: flex; align-items: center; gap: .5rem;
    padding: .5rem 1rem; font-size: .75rem; font-weight: 600;
}
.cm-system-alert--error .cm-system-alert__header { color: #991b1b; background: rgba(254,226,226,.25); border-bottom: 1px solid #fecaca; }
.cm-system-alert--warn  .cm-system-alert__header { color: #92400e; background: rgba(253,230,138,.15); border-bottom: 1px solid #fde68a; }
.cm-system-alert__header i { font-size: .8rem; }
.cm-system-alert__row {
    display: flex; align-items: flex-start; gap: .5rem;
    padding: .4rem 1rem; flex-wrap: wrap;
}
.cm-system-alert__msg {
    font-size: .78rem; color: #374151; font-weight: 500; flex: 1; min-width: 0;
}
.cm-system-alert__tags {
    display: flex; flex-wrap: wrap; gap: .2rem;
    width: 100%; padding-left: 3.3rem;
}

/* ── Tags ──────────────────────────────────────────────────────────── */
.cm-tag {
    display: inline-block; font-size: .65rem; font-weight: 500;
    padding: 2px 6px; border-radius: 4px; text-decoration: none;
    border: 1px solid transparent; transition: opacity .1s;
}
.cm-tag:hover { opacity: .8; }
.cm-tag--danger    { background: #fef2f2; color: #991b1b; border-color: #fee2e2; }
.cm-tag--warning   { background: #fffbeb; color: #92400e; border-color: #fef3c7; }
.cm-tag--secondary { background: #f9fafb; color: #6b7280; border-color: #f3f4f6; }
.cm-tag--muted     { background: transparent; color: #9ca3af; font-size: .6rem; }
.cm-tag-prod {
    font-size: .55rem; font-weight: 700; letter-spacing: .04em;
    color: #dc2626; background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 3px; padding: 1px 4px; line-height: 1.4; flex-shrink: 0;
}

/* ── Panel (generic card wrapper) ──────────────────────────────────── */
.cm-panel {
    background: #fff; border: 1px solid var(--cm-border);
    border-radius: 8px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.cm-panel--compact { box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.cm-panel__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .625rem 1rem; border-bottom: 1px solid rgba(0,0,0,.05);
}
.cm-panel__title {
    font-size: .8rem; font-weight: 600; color: #111827;
}
.cm-panel__icon {
    font-size: .75rem; color: var(--cm-text-faint); opacity: .5;
}
.cm-panel__body {
    padding: .5rem .75rem;
}
.cm-panel__body--links { padding: .375rem .375rem; }

/* ── Table helpers ─────────────────────────────────────────────────── */
.cm-project-name {
    font-weight: 600; text-decoration: none; color: #111827;
    display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
    font-size: .82rem;
}
.cm-project-name:hover { color: var(--cm-primary); }
.cm-project-client {
    display: block; font-size: .68rem; color: var(--cm-text-faint);
    text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
}
.cm-project-domain {
    font-size: .7rem; color: var(--cm-text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    text-overflow: ellipsis; overflow: hidden; white-space: nowrap;
    display: block; max-width: 8rem;
}
.cm-meta-date {
    font-size: .72rem; color: var(--cm-text-muted); white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.cm-avatar-stack { display: flex; align-items: center; }
.cm-avatar-stack .cm-avatar + .cm-avatar {
    margin-left: -.3rem; box-shadow: 0 0 0 1.5px #fff;
}
.cm-version-tag {
    display: inline-block; font-size: .65rem; font-weight: 500;
    padding: 1px 5px; border-radius: 4px; white-space: nowrap;
    background: #f0fdf4; color: #166534; border: 1px solid #d1fae5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.cm-version-tag--blue { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.cm-mono-value {
    font-size: .78rem; font-weight: 500; color: #374151;
    font-variant-numeric: tabular-nums;
}
.cm-mono-value--muted { color: #d4d4d8; }
.cm-indicator {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: .78rem; font-weight: 600;
}
.cm-indicator i { font-size: .68rem; }
.cm-indicator--danger { color: #dc2626; }
.cm-severity {
    font-size: .6rem; font-weight: 700; border-radius: 3px;
    padding: 1px 4px; line-height: 1.4; white-space: nowrap;
}
.cm-severity--critical { color: #fff; background: #dc2626; }
.cm-severity--high     { color: #92400e; background: #fef3c7; }
.cm-severity--medium   { color: #6b7280; background: #f3f4f6; }
.cm-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.65rem; height: 1.5rem; padding: 0;
    border: 1px solid var(--cm-border); border-radius: 5px;
    background: #fff; color: #b0b0b0; text-decoration: none;
    font-size: .6rem; transition: all .12s; cursor: pointer;
}
.cm-icon-btn:hover { background: #f9fafb; border-color: #d1d5db; color: #374151; }
.cm-link-muted {
    font-size: .72rem; color: var(--cm-text-faint); text-decoration: none;
    display: inline-flex; align-items: center; gap: .2rem;
    transition: color .1s;
}
.cm-link-muted i { font-size: .55rem; }
.cm-link-muted:hover { color: var(--cm-text-secondary); }

/* ── Secondary grid (bottom row) ───────────────────────────────────── */
.cm-secondary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.cm-secondary-insights {
    display: flex; flex-direction: column; gap: 1rem;
}
@media (max-width: 991.98px) {
    .cm-secondary-grid { grid-template-columns: 1fr; }
}

/* ── Distribution bars ─────────────────────────────────────────────── */
.cm-dist-row {
    display: flex; align-items: center; gap: .5rem; padding: .25rem 0;
}
.cm-dist-label {
    font-size: .68rem; font-weight: 500; color: #374151;
    min-width: 3.5rem; font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.cm-dist-bar-wrap {
    flex: 1; height: 5px; background: #f3f4f6;
    border-radius: 3px; overflow: hidden;
}
.cm-dist-bar {
    height: 100%; background: #10b981; border-radius: 3px;
    min-width: 2px; transition: width .3s;
}
.cm-dist-bar--blue { background: var(--cm-primary); }
.cm-dist-count {
    font-size: .65rem; font-weight: 600; color: var(--cm-text-faint);
    min-width: 1.25rem; text-align: right; font-variant-numeric: tabular-nums;
}
