/*
 * XpressCAT application: design-system fixes and the new document and settings
 * layouts. Loaded last; the !important rules answer the !important rules of
 * brand-system.css that would otherwise hide them.
 */
:root {
  --xc-ink: #0B1220;
  --xc-navy: #101828;
  --xc-indigo: var(--xc-brand);
  --xc-indigo-soft: var(--xc-brand-soft);
  --xc-teal: var(--xc-brand);
  --xc-teal-soft: var(--xc-brand-soft);
  --xc-ember: var(--xc-brand);
  --xc-danger: #B42318;
  --xc-danger-soft: #FEF3F2;
  --xc-line: #E4E7EC;
}

/* Initial data loading: neutral placeholders, never fabricated zero values. */
.xc-auth-home { display: inline-flex; align-items: center; min-height: 44px; border-radius: 6px; text-decoration: none; }
.xc-auth-home .xc-wordmark { font-size: 30px; }
.xc-auth-home:focus-visible { outline: 3px solid var(--xc-brand-light); outline-offset: 6px; }
.xc-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.xc-skeleton { position: relative; display: block; width: 100%; height: 14px; overflow: hidden; border-radius: 6px; background: #EAECF0; }
.xc-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent); animation: xc-skeleton-shimmer 1.6s ease-in-out infinite; }
.xc-skeleton-number { width: 72px; height: 36px; margin: 4px 0 10px; }
.xc-skeleton-detail { width: 65%; height: 11px; }
.xc-skeleton-chart { display: flex; min-height: 155px; flex-direction: column; justify-content: center; gap: 20px; }
.xc-skeleton-list { display: grid; gap: 22px; padding: 24px 20px; }
.xc-skeleton-row { display: flex; align-items: center; gap: 12px; }
.xc-skeleton-row > div { display: grid; flex: 1; gap: 10px; }
.xc-skeleton-avatar { flex: none; width: 34px; height: 34px; border-radius: 9px; }
.xc-skeleton-count { display: inline-block; width: 20px; height: 14px; margin-left: auto; background: rgba(255,255,255,.15); }
@keyframes xc-skeleton-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .xc-skeleton::after { animation: none; display: none; } }

/* Workflow statuses: one colour each. */
.status.draft { color: #475467 !important; background: #F2F4F7 !important; }
.status.progress { color: var(--xc-brand-dark) !important; background: var(--xc-indigo-soft) !important; }
.status.review { color: #B54708 !important; background: #FFFAEB !important; }
.status.changes { color: #C4320A !important; background: #FFF4ED !important; }
.status.done { color: var(--xc-brand-dark) !important; background: var(--xc-brand-soft) !important; }
.status.delivered { color: #067647 !important; background: #ECFDF3 !important; }
.status.archived { color: #98A2B3 !important; background: #F9FAFB !important; }

/* Destructive actions look destructive. */
.button.danger { border-color: #FDA29B !important; background: var(--xc-danger-soft) !important; color: var(--xc-danger) !important; }
.button.danger:hover { border-color: #F97066 !important; background: #FEE4E2 !important; }
.modal-foot .button.danger { margin-right: 0; margin-left: auto; border-color: #D92D20 !important; background: #D92D20 !important; color: #fff !important; }
.modal-foot .button.danger:hover { background: var(--xc-danger) !important; }
.text-button.member-delete,
.text-button.member-status,
.member-delete,
.member-status { color: var(--xc-danger) !important; }

/* Documents of a project: stage tabs, search and identifying details. */
.xc-doc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 12px; }
.xc-stage-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--xc-line); border-radius: 12px; background: #fff; }
.xc-stage-tabs button { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #475467; font: 600 12.5px "Inter", sans-serif; cursor: pointer; transition: background .2s ease, color .2s ease; }
.xc-stage-tabs button:hover { background: #F9FAFB; color: var(--xc-navy); }
.xc-stage-tabs button.active { background: var(--xc-navy); color: #fff; }
.xc-stage-tabs button span { min-width: 20px; padding: 2px 6px; border-radius: 99px; background: #F2F4F7; color: #475467; font-size: 11px; text-align: center; }
.xc-stage-tabs button.active span { background: rgba(255, 255, 255, .16); color: #fff; }
.xc-doc-search { min-width: 240px; }
.xc-duplicate { margin-left: 8px; padding: 2px 7px; border-radius: 99px; background: #FFF4ED; color: #C4320A; font-size: 10px; font-style: normal; font-weight: 700; vertical-align: 2px; }
.xc-doc-progress { display: block; width: 160px; max-width: 100%; height: 4px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: #EAECF0; }
.xc-doc-progress b { display: block; height: 100%; border-radius: inherit; background: var(--xc-teal); }
.data-table tbody tr[tabindex]:focus-visible { outline: 2px solid var(--xc-indigo); outline-offset: -2px; }

/* Settings: the side menu is a real set of tabs. */
.settings-menu button { display: flex !important; align-items: flex-start !important; gap: 10px !important; height: auto !important; min-height: 0 !important; padding: 11px 12px !important; text-align: left; white-space: normal !important; }
.settings-menu button > span { display: grid; gap: 3px; }
.settings-menu button b { font-size: 13px; font-weight: 700; }
.settings-menu button small { color: #667085; font-size: 11px; font-weight: 500; line-height: 1.35; }
.settings-menu button svg { flex: none; margin-top: 1px; }

/* Dashboard charts: teal = confirmed, amber = in review, red = still to do. */
.xc-charts { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 16px; margin: 18px 0; }
.xc-chart { padding: 20px 22px !important; }
.xc-chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 16px; }
.xc-chart-head h2 { margin: 0; color: var(--xc-navy); font-size: 15px; }
.xc-chart-head span { color: #667085; font-size: 12px; }
.xc-hero-figure { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.xc-hero-figure strong { color: var(--xc-navy); font: 800 48px/1 "Manrope", sans-serif; letter-spacing: -.04em; }
.xc-hero-figure span { color: #475467; font-size: 13px; }
.xc-segmented { display: flex; height: 40px; gap: 2px; overflow: visible; }
.xc-segmented span { position: relative; display: grid; min-width: 6px; place-items: center; color: #fff; font-size: 12px; font-weight: 700; outline: none; }
.xc-segmented span:first-child { border-radius: 8px 0 0 8px; }
.xc-segmented span:last-child { border-radius: 0 8px 8px 0; }
.xc-segmented span:only-child { border-radius: 8px; }
.xc-segmented .confirmed, .xc-legend .confirmed { background: var(--xc-brand); }
.xc-segmented .review, .xc-legend .review { background: #B54708; }
.xc-segmented .todo, .xc-legend .todo { background: #D03B3B; }
.xc-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 0; padding: 0; list-style: none; color: #344054; font-size: 12.5px; }
.xc-legend li { display: inline-flex; align-items: center; gap: 7px; }
.xc-legend i { width: 10px; height: 10px; border-radius: 3px; }
.xc-legend b { color: var(--xc-navy); }
.xc-columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; gap: 14px; height: 190px; }
.xc-column { position: relative; display: grid; height: 100%; grid-template-rows: auto 1fr auto; justify-items: center; gap: 6px; outline: none; }
.xc-column b { color: var(--xc-navy); font-size: 14px; }
.xc-column-track { display: flex; width: 100%; max-width: 44px; align-items: flex-end; border-bottom: 1px solid #EAECF0; }
.xc-column-track i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--xc-brand); transition: filter .2s ease; }
.xc-column:hover .xc-column-track i, .xc-column:focus-visible .xc-column-track i { filter: brightness(1.12); }
.xc-column small { color: #475467; font-size: 11.5px; text-align: center; }
.xc-meters { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.xc-meters li { position: relative; display: grid; gap: 6px; outline: none; }
.xc-meters li > span { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.xc-meters li > span b { overflow: hidden; color: var(--xc-navy); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.xc-meters li > span em { flex: none; color: #475467; font-style: normal; font-weight: 700; }
.xc-meter { display: block; height: 8px; overflow: hidden; border-radius: 99px; background: #EAECF0; }
.xc-meter b { display: block; height: 100%; border-radius: inherit; background: var(--xc-brand); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; z-index: 20; bottom: calc(100% + 8px); left: 50%; translate: -50% 0; padding: 7px 10px; border-radius: 8px; background: var(--xc-navy); color: #fff; font: 600 12px/1.3 "Inter", sans-serif; white-space: nowrap; pointer-events: none; box-shadow: 0 8px 20px rgba(16, 24, 40, .2); }
.xc-meters li[data-tip]:hover::after, .xc-meters li[data-tip]:focus-visible::after { left: auto; right: 0; translate: 0 0; }
@media (max-width: 1180px) { .xc-charts { grid-template-columns: 1fr 1fr; } .xc-charts > :first-child { grid-column: 1 / -1; } }
@media (max-width: 760px) { .xc-charts { grid-template-columns: 1fr; } }

/* Sidebar brand: the wordmark when expanded, the X mark when collapsed. */
.app-shell .sidebar .brand { display: flex !important; align-items: center !important; }
.app-shell:not(.sidebar-collapsed) .sidebar .brand .brand-content { display: none !important; }
.app-shell.sidebar-collapsed .sidebar .brand .sidebar-wordmark { display: none !important; }
.sidebar-wordmark { padding: 8px 6px; font-size: 24px; }

/* Sidebar foot: the organisation and the role, without vendor names. */
.sidebar-foot small { display: flex; align-items: center; gap: 6px; }

@media (max-width: 680px) {
  .xc-doc-toolbar { align-items: stretch; flex-direction: column; }
  .xc-stage-tabs { overflow-x: auto; flex-wrap: nowrap; }
  .xc-doc-search { min-width: 0; }
}
