:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --panel-soft: #f7f9fc;
  --panel-muted: #edf3f8;
  --line: #dbe4ee;
  --line-strong: #c7d4e0;
  --text: #16202a;
  --muted: #637489;
  --brand: #003a5d;
  --brand-deep: #0c2235;
  --brand-soft: #e8f0f6;
  --accent: #f67400;
  --accent-soft: #fff1e5;
  --danger: #bf4e3c;
  --success: #178456;
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-lg: 0 28px 60px rgba(12, 34, 53, 0.08);
  --shadow-md: 0 14px 32px rgba(12, 34, 53, 0.06);
  --shadow-sm: 0 8px 20px rgba(12, 34, 53, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(246, 116, 0, 0.07), transparent 24%),
    radial-gradient(circle at bottom right, rgba(0, 58, 93, 0.08), transparent 28%),
    linear-gradient(180deg, #fcfdff 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Source Sans 3", "Avenir Next", "Segoe UI", sans-serif;
}

body {
  padding: 16px;
  overflow-x: hidden;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(12, 34, 53, 0.32);
  backdrop-filter: blur(5px);
}

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 32px);
}

.app-sidebar,
.sidebar-section,
.workspace-header,
.summary-card,
.board-panel,
.inspector-panel,
.screen,
.dialog-card,
.surface-card,
.portal-banner,
.mini-stat {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(12, 34, 53, 0.08);
  box-shadow: var(--shadow-md);
}

.app-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  align-content: start;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 18px;
  border-radius: 24px;
  backdrop-filter: blur(18px);
}

.app-content,
.workspace-screen,
.task-detail,
.site-form,
.share-form,
.comment-form,
.task-form {
  display: grid;
  gap: 16px;
}

.app-content {
  min-width: 0;
  align-content: start;
}

.sidebar-brand,
.sidebar-section-header,
.workspace-status,
.task-meta-row,
.comment-actions,
.dialog-actions,
.dialog-topbar,
.group-header,
.table-assignee,
.toolbar-summary,
.workspace-meta-pills {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand {
  gap: 12px;
  padding: 4px 2px 8px;
}

.brand-logo {
  width: min(180px, 100%);
  height: auto;
  display: block;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  color: var(--brand-deep);
  font-size: 1rem;
  font-weight: 800;
}

.eyebrow,
.sidebar-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
}

.workspace-summary strong,
.mini-stat strong,
.site-rail-item strong,
.site-hub-card strong,
.summary-card strong,
.board-header h2,
.inspector-header h2,
.section-heading h3,
.dialog-topbar h2,
.site-item strong,
.stack-item strong {
  color: var(--brand-deep);
}

.sidebar-copy,
.section-copy,
.workspace-subtitle,
.board-copy,
.mini-stat span,
.summary-card span,
.task-cell-main span,
.toolbar-field span,
label span,
.section-heading p,
.toolbar-note,
.empty-state p,
.comment-item p,
.site-item p,
.stack-item p,
.generated-link code,
.muted {
  color: var(--muted);
}

.sidebar-copy,
.site-rail-item,
.site-rail-item p,
.site-rail-meta,
.workspace-summary strong {
  overflow-wrap: anywhere;
}

.sidebar-link-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  padding: 0;
}

.site-rail-list,
.site-directory-grid,
.stack-list,
.comment-list,
.site-list {
  display: grid;
  gap: 10px;
}

.site-rail-item {
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 6px;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.site-rail-item:hover,
.site-hub-card:hover,
.primary-button:hover,
.secondary-button:hover,
.task-table-row:hover {
  transform: translateY(-1px);
}

.site-rail-item:hover {
  background: var(--panel-soft);
}

.site-rail-item.active {
  background: linear-gradient(135deg, rgba(0, 58, 93, 0.96), rgba(12, 34, 53, 0.98));
  border-color: rgba(0, 58, 93, 0.4);
}

.site-rail-item.active strong,
.site-rail-item.active p,
.site-rail-item.active .site-rail-meta {
  color: #fff;
}

.site-rail-meta {
  font-size: 0.84rem;
  color: var(--muted);
}

.workspace-status {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--panel-soft);
  color: var(--muted);
}

.workspace-status.error {
  color: var(--danger);
  background: #fff4f2;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(23, 132, 86, 0.14);
  flex: 0 0 auto;
}

.workspace-status.error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(191, 78, 60, 0.12);
}

.primary-button,
.secondary-button {
  border-radius: 14px;
  padding: 11px 14px;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.ghost-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.compact-button {
  padding: 10px 12px;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--accent), #ff8a1d);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(246, 116, 0, 0.2);
}

.secondary-button {
  border: 1px solid rgba(0, 58, 93, 0.12);
  background: #fff;
  color: var(--brand);
  font-weight: 700;
}

.screen,
.board-panel,
.inspector-panel {
  border-radius: 24px;
}

.screen {
  padding: 22px;
}

.portal-banner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(0, 58, 93, 0.97), rgba(39, 61, 80, 0.98));
  color: #fff;
}

.portal-banner p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.8);
}

.screen-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 18px;
}

.screen-header h1,
.workspace-title-block h1 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--brand-deep);
}

.screen-sidecar {
  display: grid;
  gap: 12px;
}

.screen-header-actions {
  display: grid;
  gap: 14px;
  align-content: start;
}

.screen-cta-row,
.workspace-header-actions,
.board-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.screen-cta-row,
.workspace-header-actions {
  justify-content: flex-end;
}

.mini-stat {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
}

.mini-stat strong {
  display: block;
  margin-top: 8px;
}

.directory-toolbar,
.view-config-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.directory-toolbar {
  margin-top: 18px;
}

.bulk-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid rgba(0, 58, 93, 0.1);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(232, 240, 246, 0.88), rgba(255, 255, 255, 0.98));
}

.bulk-summary,
.bulk-controls,
.group-header-main,
.group-actions,
.group-select {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bulk-controls {
  flex-wrap: wrap;
}

.bulk-field {
  min-width: 170px;
}

.selection-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(246, 116, 0, 0.14);
}

.toolbar-badge,
.config-pill,
.meta-pill,
.active-site-badge,
.site-metric,
.site-card-kicker,
.id-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.toolbar-badge,
.site-card-kicker {
  background: var(--brand-soft);
  color: var(--brand);
}

.config-pill,
.meta-pill,
.id-pill,
.site-metric {
  background: var(--panel-muted);
  color: var(--brand);
}

.active-site-badge {
  background: var(--accent-soft);
  color: var(--accent);
}

.site-directory-grid {
  margin-top: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.site-hub-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 18px;
  text-align: left;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.site-hub-card:hover {
  border-color: rgba(0, 58, 93, 0.16);
  box-shadow: var(--shadow-md);
}

.site-card-top,
.site-card-footer {
  display: grid;
  gap: 8px;
}

.site-card-metrics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.site-hub-card p,
.site-item p,
.stack-item p,
.board-copy,
.section-copy,
.workspace-subtitle {
  margin-bottom: 0;
}

.site-card-footer {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.site-card-domain {
  color: var(--muted);
  word-break: break-word;
}

.site-card-cta {
  color: var(--brand);
  font-weight: 700;
}

.workspace-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px 22px;
}

.workspace-context {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  border-radius: 18px;
  padding: 15px 16px;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.7rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.board-panel,
.inspector-panel {
  padding: 18px;
}

.board-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.board-panel-wide {
  width: 100%;
}

.board-header,
.inspector-header,
.section-heading,
.dialog-topbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.board-header-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.board-header h2,
.inspector-header h2,
.dialog-topbar h2 {
  margin-bottom: 4px;
}

.board-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px;
  gap: 12px;
}

.toolbar-field,
label {
  display: grid;
  gap: 8px;
}

input,
select,
textarea,
code {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px 13px;
  color: var(--text);
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 58, 93, 0.28);
  box-shadow: 0 0 0 4px rgba(0, 58, 93, 0.08);
}

textarea {
  resize: vertical;
}

.table-shell {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  max-height: 72vh;
}

.task-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: separate;
  border-spacing: 0;
}

.task-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
  color: #738295;
  text-align: left;
  padding: 12px 14px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.checkbox-column,
.checkbox-cell {
  width: 44px;
  padding-left: 12px;
  padding-right: 8px;
}

.task-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  vertical-align: middle;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.98);
}

.task-table-row {
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease;
}

.task-table-row:hover td {
  background: #fbfcfe;
}

.task-table-row.active td {
  background: #fffaf5;
}

.task-table-row.active td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.group-row td {
  padding: 10px 14px;
  background: color-mix(in srgb, var(--group-color, #7f8c8d) 10%, white);
  border-bottom: 1px solid var(--line);
}

.group-header {
  justify-content: space-between;
}

.group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--brand-deep);
  font-weight: 700;
  padding: 0;
}

.group-toggle-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(12, 34, 53, 0.08);
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
}

.group-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.group-count {
  font-size: 0.84rem;
  color: var(--muted);
}

.task-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--dot, #7f8c8d);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot, #7f8c8d) 14%, white);
}

.task-cell-main {
  display: grid;
  gap: 4px;
}

.task-row-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.84rem;
}

.task-cell-main strong {
  font-size: 0.97rem;
}

.task-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.task-status-pill.light-text {
  color: var(--text);
}

.inline-cell-control {
  display: block;
}

.inline-cell-select {
  min-width: 100%;
  padding: 9px 36px 9px 12px;
  border-radius: 12px;
  border-color: transparent;
  background: var(--panel-soft);
  font-size: 0.88rem;
  font-weight: 700;
}

.inline-status-select {
  min-width: 136px;
}

.inline-cell-select:focus {
  border-color: rgba(0, 58, 93, 0.22);
  background: #fff;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.page-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
}

.table-empty-row td {
  padding: 26px 14px;
  text-align: center;
  color: var(--muted);
}

.inspector-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff, var(--panel-soft));
}

.inspector-header {
  margin-bottom: 2px;
}

.status-pill {
  background: color-mix(in srgb, var(--pill, var(--brand)) 14%, white);
}

.inspector-section,
.surface-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #fafcff);
  box-shadow: var(--shadow-sm);
}

.inspector-section {
  overflow: hidden;
}

.inspector-section summary {
  display: block;
  list-style: none;
  padding: 14px 16px;
  cursor: pointer;
}

.inspector-section summary::-webkit-details-marker {
  display: none;
}

.inspector-section summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  color: var(--muted);
  font-weight: 700;
}

.inspector-section[open] summary::after {
  content: "\2212";
}

.inspector-section summary,
.comments-section .section-body {
  position: relative;
}

.section-body {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.asset-form,
.comment-form {
  display: grid;
  gap: 14px;
}

.comment-form {
  gap: 12px;
}

.comment-form textarea {
  min-height: 112px;
}

.inline-assignee-manager {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.inline-assignee-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 6px;
}

.attachment-draft-section {
  display: grid;
  gap: 12px;
}

.attachment-draft-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.attachment-draft-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.attachment-draft-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.attachment-draft-list {
  display: grid;
  gap: 10px;
}

.attachment-draft-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.attachment-draft-pill {
  min-width: 54px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(0, 58, 93, 0.08);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.attachment-draft-input {
  width: 100%;
}

.section-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.section-heading h3 {
  margin-bottom: 4px;
}

.form-grid,
.dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.full-width {
  grid-column: 1 / -1;
}

.stack-item,
.site-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.stack-item:last-child,
.site-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.admin-option-form,
.admin-option-list {
  display: grid;
  gap: 12px;
}

.admin-card {
  align-content: start;
}

.admin-option-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
}

.admin-option-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.stack-item a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.comment-item {
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px;
  background: var(--panel-soft);
}

.comment-item.internal {
  background: rgba(0, 58, 93, 0.05);
  border-color: rgba(0, 58, 93, 0.12);
}

.comment-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.checkbox-inline {
  color: var(--muted);
}

.comment-actions {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.comment-actions .checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(0, 58, 93, 0.1);
  border-radius: 16px;
  background: rgba(0, 58, 93, 0.04);
  color: var(--brand);
  font-weight: 600;
}

.comment-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  min-width: 164px;
  justify-content: center;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: var(--brand);
}

.generated-link {
  display: grid;
  gap: 10px;
}

.dialog-card {
  width: min(560px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
}

.dialog-detail-card {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.dialog-wide {
  width: min(1120px, calc(100vw - 32px));
}

.error-text {
  color: var(--danger);
}

.read-only-board .bulk-action-bar,
.read-only-board .checkbox-column input {
  display: none !important;
}

@media (max-width: 1260px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .inspector-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: static;
  }

  .screen-header,
  .workspace-header,
  .summary-strip,
  .dialog-grid,
  .form-grid,
  .board-toolbar,
  .portal-banner {
    grid-template-columns: 1fr;
  }

  .workspace-context {
    justify-items: start;
  }

  .screen-cta-row,
  .workspace-header-actions,
  .board-header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  body {
    padding: 12px;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog-actions,
  .comment-actions,
  .dialog-topbar,
  .sidebar-section-header,
  .toolbar-summary,
  .screen-cta-row,
  .workspace-header-actions,
  .board-header-actions,
  .task-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-logo {
    width: min(170px, 100%);
  }
}

@media (max-width: 560px) {
  .summary-strip,
  .site-directory-grid {
    grid-template-columns: 1fr;
  }

  .screen,
  .board-panel,
  .inspector-panel,
  .app-sidebar {
    border-radius: 20px;
  }
}

/* 2026-03-29 layout refresh */

:root {
  --bg: #f7f9fc;
  --panel: #ffffff;
  --panel-soft: #fafbfd;
  --panel-muted: #f2f5f8;
  --line: #e3e9f0;
  --line-strong: #d2dce7;
  --text: #202938;
  --muted: #687385;
  --brand: #20466d;
  --brand-deep: #162d4b;
  --brand-soft: #eef4fb;
  --accent: #f48a24;
  --accent-soft: #fff3e7;
  --success: #2f855a;
  --danger: #c0564d;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-lg: 0 18px 38px rgba(18, 34, 56, 0.08);
  --shadow-md: 0 8px 24px rgba(18, 34, 56, 0.05);
  --shadow-sm: 0 2px 8px rgba(18, 34, 56, 0.04);
}

html,
body {
  background: #edf2f7;
}

body {
  padding: 10px;
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.app-frame {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: calc(100vh - 20px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.app-frame .app-sidebar {
  position: relative;
  top: auto;
  gap: 18px;
  padding: 18px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  backdrop-filter: none;
}

.app-main-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--bg);
}

.top-utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.top-utility-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.top-brand-logo {
  width: 126px;
  height: auto;
  display: block;
}

.top-utility-copy {
  display: grid;
  gap: 2px;
}

.top-utility-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.top-utility-copy strong {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.top-utility-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.workspace-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 24px;
  background: #edf7fd;
  border-bottom: 1px solid #d7eaf8;
  color: #35536b;
}

.workspace-notice p {
  margin: 0;
  font-size: 0.94rem;
}

.app-frame .app-content {
  gap: 22px;
  padding: 26px 28px 30px;
  background: var(--bg);
}

.app-frame .screen {
  gap: 22px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.sidebar-brand {
  gap: 10px;
  padding: 2px 4px 6px;
}

.brand-logo {
  width: 136px;
}

.brand-copy {
  gap: 0;
}

.brand-copy strong {
  font-size: 0.96rem;
  font-weight: 700;
}

.sidebar-search {
  display: grid;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.sidebar-nav {
  display: grid;
  gap: 18px;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-group-label {
  margin: 0;
  color: #8a94a6;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-item,
.app-frame .site-rail-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  box-shadow: none;
  transform: none;
}

.nav-item:hover,
.app-frame .site-rail-item:hover {
  background: #f5f8fc;
  transform: none;
}

.nav-item.active,
.app-frame .site-rail-item.active {
  background: #f1f6fd;
  border-color: #d6e1ee;
}

.nav-item.active,
.app-frame .site-rail-item.active strong,
.app-frame .site-rail-item.active p,
.app-frame .site-rail-item.active .site-rail-meta {
  color: var(--brand-deep);
}

.nav-inline-link,
.sidebar-link-button {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  padding: 0;
}

.site-rail-list {
  gap: 6px;
}

.site-rail-meta {
  font-size: 0.78rem;
}

.sidebar-summary {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 10px;
}

.sidebar-summary strong {
  font-size: 0.92rem;
  color: var(--brand-deep);
}

.sidebar-footer {
  padding-top: 6px;
}

.app-frame .workspace-status {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.page-title-block {
  display: grid;
  gap: 6px;
}

.page-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.page-kicker:empty {
  display: none;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.page-copy {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
  font-size: 1rem;
}

.page-copy:empty {
  display: none;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card,
.module-card,
.board-panel,
.dialog-card,
.surface-card,
.portal-banner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.summary-card {
  min-height: 104px;
  padding: 18px 20px;
  gap: 12px;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.summary-card strong {
  font-size: 2rem;
  line-height: 1;
}

body.client-portal .app-frame,
body.portal-shell-pending .app-frame {
  grid-template-columns: minmax(0, 1fr);
}

body.client-portal .app-sidebar,
body.portal-shell-pending .app-sidebar {
  display: none;
}

body.client-portal .top-utility-bar,
body.portal-shell-pending .top-utility-bar {
  padding: 18px 28px 16px;
}

body.portal-shell-pending .top-utility-actions {
  display: none;
}

body.client-portal #refreshButton,
body.portal-shell-pending #refreshButton {
  display: none;
}

body.client-portal .top-utility-status,
body.portal-shell-pending .top-utility-status {
  display: none;
}

body.client-portal .workspace-side-column,
body.portal-shell-pending .workspace-side-column {
  display: none;
}

body.client-portal .workspace-module-grid,
body.portal-shell-pending .workspace-module-grid {
  grid-template-columns: minmax(0, 1fr);
}

body.client-portal .module-span-three,
body.portal-shell-pending .module-span-three {
  grid-column: auto;
}

body.client-portal #workspaceHeaderKicker,
body.client-portal #activeSiteBadge,
body.client-portal #siteAccessBanner {
  display: none !important;
}

.site-access-screen {
  display: grid;
  min-height: min(520px, calc(100vh - 120px));
  place-items: center;
}

.site-access-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.site-access-card h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.site-access-form {
  display: grid;
  gap: 14px;
}

.site-access-form input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-align: center;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.module-span-two {
  grid-column: span 2;
}

.module-span-three {
  grid-column: span 3;
}

.workspace-module-grid {
  align-items: start;
}

.workspace-side-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.module-card {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.module-header h2 {
  margin: 0;
  font-size: 1.12rem;
  color: var(--brand-deep);
}

.module-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.home-summary-strip .summary-card:first-child,
.summary-strip .summary-card:first-child {
  border-top: 2px solid rgba(32, 70, 109, 0.12);
}

.site-directory-list,
.compact-stack-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.site-hub-card {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: left;
  box-shadow: none;
}

.site-hub-card:hover {
  background: #fbfcfe;
  transform: none;
}

.site-card-top {
  display: grid;
  gap: 6px;
}

.site-card-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-card-top strong,
.site-card-top p {
  margin: 0;
}

.site-card-top p {
  color: var(--muted);
}

.site-card-metrics,
.site-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-metric,
.site-card-domain,
.site-card-cta,
.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--brand-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

.site-card-cta {
  background: var(--brand-soft);
}

.setup-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 20px 18px;
}

.setup-overview-item {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.setup-overview-item strong {
  font-size: 1.5rem;
  color: var(--brand-deep);
}

.setup-overview-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.module-card > .secondary-button,
.module-card > .primary-button,
.module-card > .ghost-button {
  margin: 0 20px 20px;
  justify-self: start;
}

.board-panel {
  overflow: hidden;
}

.board-header,
.board-toolbar,
.view-config-bar,
.bulk-action-bar {
  padding-left: 20px;
  padding-right: 20px;
}

.board-header {
  padding-top: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.board-header h2 {
  margin: 0;
  font-size: 1.45rem;
}

.board-copy {
  margin: 6px 0 0;
  max-width: 720px;
}

.board-toolbar {
  align-items: end;
  padding-top: 16px;
  padding-bottom: 14px;
}

.toolbar-field span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.toolbar-field input,
.toolbar-field select,
label input,
label select,
label textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

.view-config-bar {
  gap: 8px;
  padding-bottom: 14px;
}

.config-pill,
.meta-pill {
  background: var(--panel-muted);
  color: var(--brand-deep);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.bulk-action-bar {
  margin: 0 20px 16px;
  padding: 12px 14px;
  border: 1px solid #d9e7f5;
  border-radius: 12px;
  background: #f5faff;
}

.table-shell {
  margin-top: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
}

.task-table {
  min-width: 100%;
}

.task-table thead th {
  background: #f8fafc;
  color: #586779;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  border-bottom: 1px solid var(--line);
}

.task-table tbody td {
  border-bottom: 1px solid #eef2f6;
}

.group-row td {
  background: #fbfcfe;
}

.group-header {
  min-height: 44px;
}

.group-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--brand-deep);
  font-weight: 700;
}

.task-table-row.active {
  background: #f4f8fd;
}

.id-pill {
  background: #f0f4f8;
  color: var(--brand-deep);
}

.inline-cell-select {
  min-height: 36px;
  border-radius: 9px;
}

.context-list {
  display: grid;
  gap: 0;
  padding: 6px 0;
}

.context-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.context-item:first-child {
  border-top: 0;
}

.context-item span {
  color: var(--muted);
  font-size: 0.88rem;
}

.context-item strong {
  color: var(--brand-deep);
  text-align: right;
}

.compact-stack-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.compact-stack-item strong,
.compact-stack-item p {
  margin: 0;
}

.compact-stack-item p {
  color: var(--muted);
  font-size: 0.88rem;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.stack-item,
.site-item,
.comment-item,
.admin-option-item {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.site-item,
.stack-item,
.admin-option-item {
  padding: 14px 16px;
}

.portal-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #fff8f1;
  border-color: #f2ddc2;
  color: #704a18;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  box-shadow: none;
}

.primary-button {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
}

.primary-button:hover {
  background: #1b3d60;
  transform: none;
}

.secondary-button {
  background: #fff;
  color: var(--brand-deep);
  border: 1px solid var(--line-strong);
}

.secondary-button:hover,
.ghost-button:hover {
  background: #f7f9fc;
  transform: none;
}

.ghost-button {
  background: transparent;
  color: var(--brand);
  border: 1px solid transparent;
}

.dialog-card {
  width: min(1100px, calc(100vw - 36px));
  padding: 22px;
  box-shadow: 0 20px 54px rgba(18, 34, 56, 0.16);
}

.dialog-detail-card {
  width: min(1180px, calc(100vw - 36px));
}

.dialog-wide {
  width: min(1240px, calc(100vw - 36px));
}

.dialog-topbar {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading h3,
.dialog-topbar h2 {
  margin: 0;
}

.section-heading p,
.dialog-topbar p {
  margin: 4px 0 0;
}

@media (max-width: 1180px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-span-two,
  .module-span-three {
    grid-column: span 2;
  }

  .workspace-side-column {
    grid-column: span 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-hub-card {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 980px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .app-frame .app-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .sidebar-summary {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .top-utility-bar,
  .workspace-notice,
  .page-header,
  .page-header-actions,
  .board-toolbar,
  .bulk-controls,
  .context-item {
    align-items: stretch;
    flex-direction: column;
  }

  .app-frame .app-content {
    padding: 20px;
  }

  .summary-strip,
  .module-grid,
  .workspace-side-column,
  .setup-overview {
    grid-template-columns: 1fr;
  }

  .module-span-two,
  .module-span-three,
  .workspace-side-column {
    grid-column: span 1;
  }

  .top-utility-actions,
  .page-header-actions {
    width: 100%;
  }

  .top-utility-actions > button,
  .page-header-actions > button,
  .page-header-actions > div {
    width: 100%;
  }
}

/* simplified admin rail */

.app-frame {
  grid-template-columns: 220px minmax(0, 1fr);
}

.app-frame .app-sidebar {
  gap: 24px;
  padding: 24px 16px;
}

.sidebar-brand {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 0;
}

.brand-logo {
  width: 148px;
}

.brand-copy strong {
  font-size: 1.05rem;
}

.sidebar-nav {
  display: block;
}

.sidebar-nav .nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.top-utility-bar {
  justify-content: space-between;
}

.top-utility-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.page-header-actions:empty {
  display: none;
}

.site-board-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.site-hub .page-header-actions {
  align-items: flex-end;
}

.site-hub .page-header-actions > button {
  align-self: flex-end;
}

.board-view-select {
  min-width: 180px;
}

.board-view-select select {
  min-width: 180px;
}

.site-board-card-grid .site-hub-card {
  min-height: 156px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: 14px;
}

.site-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-deep);
  border: 1px solid rgba(0, 58, 93, 0.1);
  flex: 0 0 auto;
}

.site-card-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.site-card-avatar-fallback {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.site-card-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.site-card-content strong {
  font-size: 1.1rem;
  color: var(--brand-deep);
}

.dialog-compact {
  width: min(520px, calc(100vw - 36px));
}

.create-site-form {
  display: grid;
  gap: 16px;
  padding-top: 18px;
}

.view-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.view-toggle-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.view-toggle-button.active {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.destructive-button {
  border-color: #e7c4c1;
  color: #a13f37;
}

.destructive-button:hover {
  background: #fff6f5;
}

@media (max-width: 1080px) {
  .site-board-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .site-board-card-grid {
    grid-template-columns: 1fr;
  }
}
