/* Components, ds-* as in the hub's component layer. A page builds from these and adds no style of its own. */

.ds-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 20px; }
.ds-page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.ds-page-head .ds-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.ds-sub { color: var(--text-muted); font-size: var(--fs-body); margin-top: 6px; }
.ds-stack { display: flex; flex-direction: column; gap: var(--sp-5); }
.ds-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ds-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .ds-grid-2, .ds-grid-4 { grid-template-columns: minmax(0, 1fr); } }

/*
 * The card, as the hub's platform cards: white on the gray app background, with whitespace between cards.
 * A split card puts a hairline under its head; repeated records inside one are __sections, divided by hairlines.
 * --nested is a card inside a card, only for a record with actions of its own. ds-inset sets a block apart within a section.
 */
.ds-panel { background: var(--white); border: 1px solid var(--border-solid); border-radius: var(--r-lg); padding: var(--sp-6); min-width: 0; }
.ds-panel__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.ds-panel--split { padding: 0; }
.ds-panel--split > .ds-panel__head { margin: 0; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border-solid); }
.ds-panel__body, .ds-panel__section { padding: var(--sp-5); min-width: 0; }
.ds-panel__section + .ds-panel__section { border-top: 1px solid var(--border-solid); }
.ds-panel--nested { border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); }
.ds-inset { background: var(--gray-bg); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); }
.ds-panel__title { font-size: 17px; font-weight: 700; }
.ds-panel__head .ds-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.ds-kicker { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }

.ds-meta { font-size: 13px; color: var(--text-muted); }
.ds-mono { font-family: var(--mono); font-size: 13px; }

.ds-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--r-sm); font: inherit; font-weight: 600; font-size: var(--fs-body); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.ds-btn--primary { background: var(--blue); color: var(--white); }
.ds-btn--primary:hover { background: var(--blue-dark); color: var(--white); }
.ds-btn--ghost { background: var(--white); color: var(--dark); border-color: var(--border-strong); }
.ds-btn--ghost:hover { border-color: var(--blue); color: var(--blue-dark); }
.ds-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.ds-chip { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; white-space: nowrap; border: 1px solid var(--border-solid); background: #f3f4f6; color: #4b5563; }
.ds-chip--green { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.ds-chip--amber { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-border); }
.ds-chip--red { background: var(--red-bg); color: var(--red-text); border-color: var(--red-border); }
.ds-chip--blue { background: var(--blue-pale); color: var(--blue-dark); border-color: var(--blue-light); }
.ds-chip--purple { background: var(--purple-bg); color: var(--purple-text); border-color: #ddd6fe; }

/* A closing identity: how the parts add up, in the words the code computed. Never rephrased. */
.ds-identity { display: block; font-family: var(--mono); font-size: 12.5px; color: #4b4f63; background: var(--gray-bg); border-radius: var(--r-xs); padding: 8px 10px; overflow-wrap: anywhere; }

.ds-stat { background: var(--white); border: 1px solid var(--border-solid); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.ds-stat__value { display: block; font-size: 28px; font-weight: 700; line-height: var(--lh-tight); margin: 4px 0; }
.ds-stat__note { font-size: 12px; color: var(--text-muted); }

.ds-callout { display: flex; gap: 12px; align-items: flex-start; border-radius: 10px; padding: 12px 14px; font-size: var(--fs-body); background: var(--blue-pale); border: 1px solid var(--blue-light); color: var(--dark); }
.ds-callout--amber { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-text); }
.ds-callout--purple { background: var(--purple-bg); border-color: #ddd6fe; color: var(--purple-text); }
.ds-callout--red {background: var(--red-bg); border-color: var(--red-border); color: var(--red-text); }

/* An empty state carries its reason: an empty list and a list nobody looked at must not look alike. */
.ds-empty { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 14px; font-size: var(--fs-body); color: #4b4f63; }

.ds-table-wrap { overflow-x: auto; }
.ds-table { border-collapse: collapse; width: 100%; font-size: var(--fs-body); }
.ds-table th { text-align: left; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border-solid); white-space: nowrap; }
.ds-table td { padding: 10px; border-bottom: 1px solid #eef0f4; vertical-align: top; }
.ds-table td.ds-num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

.ds-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border-solid); margin-bottom: 20px; }
.ds-tab { padding: 10px 14px; font-size: var(--fs-body); font-weight: 600; color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent; }
.ds-tab:hover { color: var(--blue-dark); }
.ds-tab.is-active { color: var(--blue); border-bottom-color: var(--blue); }

.ds-field { display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-body); font-weight: 600; }
.ds-hint { font-weight: 400; font-size: 12.5px; color: var(--text-muted); }
.ds-input, .ds-select, .ds-textarea { font: inherit; font-weight: 400; border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 9px 10px; min-height: 40px; background: var(--white); color: var(--dark); width: 100%; }
.ds-textarea { min-height: 80px; }
.ds-select { max-width: 100%; text-overflow: ellipsis; }
.ds-input:focus, .ds-select:focus, .ds-textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); outline: none; }

/* A list page's filters: one labelled select each, submitted on change. */
.ds-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ds-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; font-weight: 600; }
.ds-identities { display: flex; flex-direction: column; gap: 6px; }

.ds-dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 16px; font-size: var(--fs-body); }
.ds-dl dt { color: var(--text-muted); }
/* In a side panel the value column is too narrow for a chip or an identifier, so each term sits above its value. */
.ds-dl--stacked { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
.ds-dl--stacked dd + dt { margin-top: 10px; }
