/* Minimal styling for TemplateCore's suite page (the tc-* classes used by Suites.razor). Functional,
   not pretty — enough to make the local host usable. */
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Figtree', Segoe UI, system-ui, sans-serif; color: #111827; background: #f4f5f7; }

/* The whole app fills the viewport and NEVER scrolls as a page — only inner regions scroll. */
html, body { height: 100%; margin: 0; overflow: hidden; }
.tc-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.tc-list { flex: 1; min-height: 0; overflow-y: auto; }
.tc-bar { display: flex; align-items: baseline; gap: 1rem; padding: 0.9rem 1.4rem; background: #ffffff; color: #111827; border-bottom: 1px solid #e5e7eb; }
.tc-brand { font-weight: 700; font-size: 1.15rem; letter-spacing: .3px; color: #4f46e5; }
.tc-sub { font-size: .8rem; color: #6b7280; }

/* align-content: start is what keeps a card a CARD. Without it the grid distributes its rows over the
   full height it was given by flex:1, so a list holding one item renders that item as a full-screen
   block — which is what a single site looked like. */
.tc-list { padding: 1.2rem 1.4rem; display: grid; gap: .8rem; align-content: start; }
.tc-empty { padding: 1rem; color: #6b7280; }
.tc-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem;
           background: #fff; border: 1px solid #e3e8f0; border-radius: 10px; padding: .9rem 1.1rem; }

/* ── List screen: lists left, the receiver's live log right ──────────────────────────────────────────
   The log belongs HERE and only here. Packaging and publishing are asked for from this screen and
   answered by a different process, so without it the operator clicks a button and has no way of knowing
   whether anything happened — which is exactly how it read before. Inside a suite the relevant output is
   that suite's own build log, not the receiver's, so this pane is not rendered there.

   The pane itself reuses .tc-logpanel / .tc-logpanel-head / .tc-logpanel-body from the suite view: it is
   the same kind of thing — another process's stdout — and giving it its own styling would have made two
   log panels that look unrelated while doing the same job. */
.tc-listpane { display: flex; flex: 1; min-height: 0; }
.tc-listpane-left { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* The head is a flex row here so the pause/refresh controls can sit at its right edge; it stays a plain
   label everywhere else it is used. */
.tc-logpanel-head { display: flex; align-items: center; gap: .4rem; }
.tc-logpanel-head .tc-spacer { flex: 1; }
.tc-loghead-btn { font-size: .7rem; line-height: 1; padding: .15rem .4rem; border-radius: 4px;
                  border: 1px solid #d4dbe8; background: #fff; color: #6b7280; cursor: pointer; }
.tc-loghead-btn:hover { background: #e8eef9; color: #111827; }
.tc-card-name { font-weight: 600; font-size: 1.02rem; }
.tc-card-meta { font-size: .8rem; color: #6b7280; margin-top: .15rem; }
.tc-card-verdicts { display: flex; gap: .5rem; align-items: center; margin-top: .45rem; }
.tc-card-progress { font-size: .75rem; color: #6b7280; }
.tc-card-actions { display: flex; gap: .5rem; }

.tc-runner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.tc-runner-bar { display: flex; align-items: center; gap: .6rem; padding: .7rem 1.1rem;
                 background: #fff; border-bottom: 1px solid #e3e8f0; }
.tc-runner-name { font-weight: 600; }
.tc-spacer, .tc-runner-bar .tc-spacer { flex: 1; }
.tc-note { padding: .35rem .55rem; border: 1px solid #cdd5e3; border-radius: 6px; font-size: .8rem; min-width: 12rem; }
.tc-runner-body { display: flex; flex: 1; min-height: 0; }
.tc-applist { width: 270px; border-right: 1px solid #e3e8f0; background: #fafbfe; overflow-y: auto; padding: .5rem; }
.tc-applist-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: #8a93a6; padding: .6rem .4rem .25rem; }
.tc-app { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap;
          padding: .25rem .35rem; border-radius: 6px; }
.tc-app-active { background: #eef2ff; }
.tc-app-open { display: flex; align-items: center; gap: .5rem; flex: 1; background: none; border: 0; cursor: pointer; text-align: left; padding: .25rem; }
.tc-app-name { flex: 1; font-size: .85rem; }
.tc-app-actions { display: flex; gap: .25rem; }
.tc-app-note { flex: 1 1 100%; box-sizing: border-box; margin: .1rem .25rem .15rem; padding: .2rem .45rem;
               border: 1px solid #cdd5e3; border-radius: 5px; font-size: .72rem; }
.tc-runner-view { flex: 1; min-width: 0; display: flex; }
.tc-frame { flex: 1; width: 100%; height: 100%; border: 0; }
.tc-building, .tc-warming { flex: 1; padding: 1.2rem; }
.tc-building-head { font-weight: 600; margin-bottom: .6rem; }
.tc-log { background: #0f1420; color: #cfe3ff; padding: .8rem; border-radius: 8px; font-size: .75rem;
          height: calc(100vh - 220px); overflow: auto; white-space: pre-wrap; }

.tc-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #c2c9d6; }
.tc-dot-pass { background: #16a34a; } .tc-dot-fail { background: #dc2626; } .tc-dot-pending { background: #eab308; }

.tc-btn { padding: .4rem .7rem; border: 1px solid #cdd5e3; background: #fff; border-radius: 7px; cursor: pointer; font-size: .82rem; }
.tc-btn:hover { background: #f0f3fa; }
.tc-btn-xs { padding: .15rem .4rem; border-radius: 5px; border: 1px solid #cdd5e3; background: #fff; cursor: pointer; }
.tc-btn-lime { background: #d9f99d; border-color: #bef264; }
.tc-btn-pass { background: #dcfce7; border-color: #86efac; }
.tc-btn-fail { background: #fee2e2; border-color: #fca5a5; }

.tc-badge, .tc-badge-sm { padding: .15rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.tc-badge-sm { font-size: .68rem; }
.tc-badge-kind { background: #e0e7ff; color: #3730a3; }
.tc-backend-note { font-size: .8rem; color: #5b647a; margin-bottom: .6rem; max-width: 60ch; line-height: 1.45; }
.tc-backend-note code { background: #eef2ff; padding: .05rem .3rem; border-radius: 4px; font-size: .76rem; }
.tc-badge-pass { background: #dcfce7; color: #166534; }
.tc-badge-fail { background: #fee2e2; color: #991b1b; }
.tc-badge-pending { background: #fef9c3; color: #854d0e; }

/* ── Suite-view: tabbed sidebar (Review / Chat) + tabbed main (Apps / Tables / Ops) ── */
.tc-side { width: 300px; border-right: 1px solid #e3e8f0; background: #fafbfe; display: flex; flex-direction: column; min-height: 0; }
.tc-side-tabs, .tc-main-tabs { display: flex; gap: 2px; padding: .4rem .4rem 0; border-bottom: 1px solid #e3e8f0; background: #f2f5fb; flex-shrink: 0; }
.tc-side-tab, .tc-main-tab { flex: 1; padding: .5rem .4rem; border: 0; background: transparent; cursor: pointer; font-size: .8rem; font-weight: 600; color: #6b7280; border-bottom: 2px solid transparent; }
.tc-side-tab.on, .tc-main-tab.on { color: #0891b2; border-bottom-color: #0891b2; }
.tc-main-tab { flex: 0 0 auto; padding: .55rem 1.1rem; }
.tc-side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: .5rem; }
/* Enlarged, scrollable per-app feedback boxes. */
.tc-app-note { flex: 1 1 100%; box-sizing: border-box; margin: .25rem .25rem .35rem; padding: .45rem .55rem; min-height: 3.2rem; resize: vertical; border: 1px solid #d7deea; border-radius: 6px; font-size: .8rem; font-family: inherit; }

.tc-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: .5rem; gap: .5rem; }
.tc-chat-log { flex: 1; min-height: 0; overflow-y: auto; background: #0f1420; color: #cfe3ff; padding: .7rem; border-radius: 8px; font-size: .74rem; white-space: pre-wrap; margin: 0; }
.tc-chat-input { display: flex; gap: .4rem; align-items: flex-end; }
.tc-chat-input textarea { flex: 1; resize: vertical; min-height: 2.6rem; padding: .45rem .55rem; border: 1px solid #d7deea; border-radius: 7px; font-size: .82rem; font-family: inherit; }

.tc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.tc-main-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }
.tc-main-body > .tc-frame { flex: 1; }
.tc-panel { flex: 1; min-height: 0; overflow-y: auto; padding: .6rem .8rem; }
.tc-panel-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; font-weight: 700; color: #374151; }
.tc-table-row { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; border: 1px solid #e5e9f2; border-radius: 8px; margin-bottom: .35rem; font-size: .85rem; background: #fff; }
.tc-table-row i { font-size: 1.05rem; color: #0891b2; }

.tc-op { border: 1px solid #e5e9f2; border-radius: 8px; margin-bottom: .4rem; background: #fff; overflow: hidden; }
.tc-op-head { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; background: none; border: 0; cursor: pointer; text-align: left; }
.tc-op-layer { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: #0891b2; padding: .12rem .4rem; border-radius: 4px; }
.tc-op-name { font-weight: 600; font-size: .85rem; color: #111827; flex: 1; }
.tc-op-io { font-size: .72rem; color: #9ca3af; }
.tc-op-body { padding: .1rem .7rem .6rem; border-top: 1px solid #eef1f6; }
.tc-op-field { display: flex; flex-direction: column; gap: .15rem; margin: .5rem 0; }
.tc-op-field label { font-size: .74rem; color: #6b7280; }
.tc-op-field label small { color: #9ca3af; }
.tc-op-field .form-input { padding: .4rem .55rem; border: 1px solid #d7deea; border-radius: 6px; font-size: .82rem; }
.tc-op-out { font-size: .74rem; color: #6b7280; margin: .3rem 0; }
.tc-op-result { background: #0f1420; color: #cfe3ff; padding: .6rem; border-radius: 6px; font-size: .72rem; margin-top: .5rem; max-height: 240px; overflow: auto; white-space: pre-wrap; }

/* Far-right running-process log panel — scrolls on its own; never grows the page. */
.tc-logpanel { width: 380px; flex-shrink: 0; border-left: 1px solid #e3e8f0; background: #fafbfe; display: flex; flex-direction: column; min-height: 0; }
.tc-logpanel-head { padding: .55rem .75rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; border-bottom: 1px solid #e3e8f0; background: #f2f5fb; flex-shrink: 0; }
/* Second header separates the two stacked panes; both .tc-logpanel-body have flex:1 so they split 50/50. */
.tc-logpanel-head-2 { border-top: 1px solid #e3e8f0; }
.tc-logpanel-body { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: .7rem; background: #0f1420; color: #cfe3ff; font-size: .72rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.tc-chat-log { word-break: break-word; }

/* ── Client repos: one working copy per company, three branches in it ─────────────────────────
   The environment picker is three buttons rather than a <select> on purpose: all three are always
   worth seeing, and which one is CHECKED OUT is the single fact the row exists to show. A closed
   select would hide two of them and show the current one as if it were a preference rather than
   the state of a folder on disk. */
.tc-envpick { align-items: center; }
.tc-envpick .tc-btn-xs { min-width: 2.9rem; font-size: .72rem; font-weight: 600; color: #6b7280; }
.tc-env-on { background: #cffafe; border-color: #67e8f9; color: #0e7490; }
.tc-envpick .tc-btn-xs:disabled { opacity: .55; cursor: default; }

/* What is inside the checkout, under the badges. Wraps rather than scrolls: a company with a dozen
   suites should make the row taller, not hide the last of them behind an edge. */
.tc-client-contents { margin-top: .3rem; font-size: .76rem; color: #4b5563; word-break: break-word; }

/* A switch that did not happen. Loud, because the tree is still on the branch it was on and the
   operator is otherwise looking at a row that did not change for no visible reason. */
.tc-client-error { color: #991b1b; background: #fee2e2; border-radius: 8px; margin: .4rem; padding: .7rem .9rem; }
.tc-client-item { display: inline-block; padding: .1rem .45rem; margin: .1rem .25rem .1rem 0; border: 1px solid #e5e9f2; border-radius: 6px; background: #fff; }

/* ── A COMPANY, AS A FOLDER ───────────────────────────────────────────────────────────────────
   A business has a clone per artefact kind, and on a VM that has served both consoles, per origin
   too. Listing every checkout flat put four near-identical rows on screen for one company. The
   folder is the company; the repositories are what is inside it. */
.tc-company { border: 1px solid #e5e9f2; border-radius: 10px; background: #fff; margin: .4rem; overflow: hidden; }
.tc-company.is-open { border-color: #c7d2fe; }

.tc-company-head { display: flex; align-items: center; gap: .55rem; padding: .6rem .8rem; cursor: pointer; user-select: none; }
.tc-company-head:hover { background: #f8fafc; }
.tc-company-head:focus-visible { outline: 2px solid #6366f1; outline-offset: -2px; }
.tc-company.is-open .tc-company-head { background: #f8fafc; border-bottom: 1px solid #e5e9f2; }

.tc-company-twisty { color: #9ca3af; font-size: .8rem; width: .8rem; flex-shrink: 0; }
.tc-company-icon { font-size: .95rem; flex-shrink: 0; }

/* The id is the identity, so it gets the monospace treatment and does not wrap — a truncated GUID
   is still recognisable by its head, a wrapped one is two lines of noise. */
.tc-company-id { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem;
                 font-weight: 600; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-company-sum { flex: 1; min-width: 0; font-size: .76rem; color: #6b7280;
                  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The cards inside lose their own outer margin — the folder supplies the padding now. */
.tc-company-repos { padding: .25rem .3rem .45rem; background: #fcfdff; }
.tc-company-repos .tc-card { margin: .3rem .35rem; }

/* The suites inside a client's checkout, each with the same actions a platform suite has. A row per
   item rather than chips, because each one now carries buttons. */
.tc-client-items { margin-top: .4rem; display: flex; flex-direction: column; gap: .2rem; }
.tc-client-item-row { display: flex; align-items: center; gap: .5rem; padding: .28rem .45rem; border: 1px solid #e5e9f2; border-radius: 7px; background: #fff; font-size: .78rem; }
.tc-client-item-name { flex: 1; min-width: 0; font-weight: 600; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-client-item-stage { color: #6b7280; font-size: .72rem; }
.tc-client-item-actions { display: flex; gap: .25rem; align-items: center; flex-shrink: 0; }
