/* Zimac Org Sites — service-specific styles.
 *
 * The design system (tokens, buttons, cards, tables, badges, the toast) lives
 * once in the shared internal UI kit — zimac_common::ui, served at
 * /zimac-ui.css and linked *before* this file. What remains here is unique to
 * the sites viewer: the single-column page shell, the portal's site cards, the
 * site page's header/sections, the inline row editor + composer, and the
 * activity feed. All of it leans on the kit's tokens so colours stay in
 * lockstep with the rest of the family. */

body.sites-page {
  min-height: 100vh;
  background: var(--zui-aurora), var(--bg);
}

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.page-head {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin-bottom: 26px;
}
.page-head .brand {
  text-decoration: none;
}
.page-head .who {
  font-size: 12.5px;
  color: var(--muted);
}

/* --- sign-in card ---------------------------------------------------------- */

.signin-card {
  max-width: 440px;
  margin: 8vh auto 0;
  padding: 38px 36px 30px;
  box-shadow: var(--zui-shadow-3);
  animation: zui-rise 0.35s ease;
}
.signin-brand {
  margin-bottom: 26px;
}
.signin-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.signin-lede {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 22px;
}
.signin-card .field {
  margin-bottom: 14px;
}
.signin-btn {
  width: 100%;
}

/* --- portal: the tenant's sites -------------------------------------------- */

.list-head {
  margin-bottom: 18px;
}
.list-head h1 {
  font-size: 22px;
  margin: 0;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

a.site-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
a.site-card:hover {
  text-decoration: none;
}
.site-card-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.site-card-sub {
  font-size: 12.5px;
  color: var(--muted);
}

/* --- site page -------------------------------------------------------------- */

.site-head {
  margin-bottom: 20px;
}
.site-head h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.site-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section {
  margin-bottom: 20px;
}
.section h2 {
  font-size: 16px;
  margin: 0 0 8px;
}
.section p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  /* Section bodies are plain text; preserve the author's line breaks. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.table-card,
.activity-card {
  margin-bottom: 20px;
}
.table-wrap {
  overflow-x: auto;
}
.table-card .data-table {
  box-shadow: none;
}
.data-table td .cell-input {
  min-width: 110px;
}
.row-attrib {
  font-size: 11.5px;
  color: var(--zui-text-faint);
  margin-top: 3px;
}
.row-actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

/* --- the add-row composer ---------------------------------------------------- */

.composer {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.composer-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.composer .field {
  min-width: 140px;
  flex: 1;
}

/* --- activity ----------------------------------------------------------------- */

.activity {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.activity li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}
.activity .actor {
  font-weight: 600;
  color: var(--accent-2);
}
.activity .when {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--zui-text-faint);
  white-space: nowrap;
}

/* --- SSO sign-in: the one-click button first, the token form as a fallback -- */
.signin-card #sso-btn {
  width: 100%;
}
.token-fallback {
  margin-top: 14px;
  text-align: left;
}
.token-fallback summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--zui-text-muted);
}
.token-fallback summary:hover {
  color: var(--zui-text);
}
.token-fallback[open] summary {
  margin-bottom: 10px;
}
