:root {
  --tc-blue: #00a1d4;
  --tc-navy: #2d343d;
  --tc-grey: #b2b2b2;
  --tc-black: #000000;
  --tc-white: #ffffff;
  --tc-orange: #ff4c1e;
  --tc-green: #2fd688;
  --tc-yellow: #ffe100;
  --tc-coral: #ff3550;
  --tc-purple: #a239b8;
  --ink: #161a1f;
  --muted: #67717c;
  --line: #dbe2e8;
  --surface: #f5f8fa;
  --soft-blue: #e5f7fc;
  --soft-green: #e8fbf4;
  --soft-yellow: #fff9cc;
  --soft-coral: #ffe4e8;
  --shadow: 0 16px 40px rgba(45, 52, 61, 0.12);
  --radius: 8px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--surface);
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

a {
  color: inherit;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(420px, 1.15fr);
  background: var(--tc-navy);
  color: var(--tc-white);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px;
  min-height: 100vh;
}

.logo-stack {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--tc-white);
  border-radius: 50%;
  font-weight: 800;
  line-height: 1;
}

.logo-image {
  width: 168px;
  max-height: 42px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.logo-text {
  display: grid;
  gap: 2px;
}

.logo-text strong {
  font-size: 18px;
}

.logo-text span,
.login-brand p,
.eyebrow,
.meta,
.hint {
  color: rgba(255, 255, 255, 0.74);
}

.login-copy h1,
.page-title h1,
.section-title h2,
.modal h2 {
  margin: 0;
  font-family: Impact, "Arial Narrow", Arial, sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 0.92;
}

.login-copy h1 {
  max-width: 620px;
  font-size: 56px;
}

.login-copy p {
  max-width: 540px;
  margin: 22px 0 0;
  font-size: 18px;
  line-height: 1.45;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background: var(--tc-white);
  color: var(--ink);
}

.login-card {
  width: min(100%, 510px);
  background: var(--tc-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.45;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--tc-navy);
}

.field input,
.field select,
.field textarea,
.search-input,
.status-filter {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 42px;
  padding: 10px 12px;
  background: var(--tc-white);
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus,
.status-filter:focus {
  border-color: var(--tc-blue);
  box-shadow: 0 0 0 3px rgba(0, 161, 212, 0.16);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.demo-account {
  text-align: left;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f9fbfc;
}

.demo-account strong {
  display: block;
  font-size: 13px;
  color: var(--tc-navy);
}

.demo-account span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--tc-navy);
  color: var(--tc-white);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar .logo-stack {
  padding: 0 6px;
}

.sidebar .logo-image {
  width: 142px;
}

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

.nav-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  padding: 10px 12px;
  text-align: left;
}

.nav-button.active,
.nav-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--tc-white);
  border-color: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.13);
  font-size: 12px;
  font-weight: 800;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.user-chip {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.user-chip strong,
.user-chip span {
  display: block;
}

.user-chip span {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar,
.page-title,
.section-title,
.actions-row,
.filters,
.form-actions,
.attribute-row,
.audit-row,
.version-row,
.credential-row {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.crumb {
  color: var(--muted);
  font-size: 13px;
}

.page-title {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title h1 {
  font-size: 40px;
  color: var(--tc-navy);
}

.page-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--tc-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(45, 52, 61, 0.06);
}

.panel.pad {
  padding: 20px;
}

.section-title {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-title h2 {
  font-size: 24px;
  color: var(--tc-navy);
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 14px;
  font-weight: 700;
  color: var(--tc-navy);
  background: var(--tc-white);
  text-decoration: none;
}

.btn.primary {
  background: var(--tc-blue);
  border-color: var(--tc-blue);
  color: var(--tc-white);
}

.btn.secondary {
  background: var(--tc-navy);
  border-color: var(--tc-navy);
  color: var(--tc-white);
}

.btn.ghost {
  border-color: var(--line);
  background: var(--tc-white);
}

.btn.danger {
  border-color: var(--tc-coral);
  color: var(--tc-coral);
  background: var(--tc-white);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(45, 52, 61, 0.12);
}

.filters {
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.filters-left {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 170px;
  gap: 10px;
  flex: 1;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  text-align: left;
}

th {
  color: var(--tc-navy);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fbfdfe;
}

.sortable {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-weight: 800;
  text-transform: uppercase;
}

.site-cell {
  display: grid;
  grid-template-columns: 118px minmax(180px, 1fr);
  align-items: center;
  gap: 14px;
}

.thumb {
  width: 118px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--tc-navy);
  display: grid;
  place-items: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.logo-thumb img {
  object-fit: contain;
  padding: 18px;
  background: var(--tc-white);
}

.site-name {
  display: grid;
  gap: 5px;
}

.site-name strong {
  color: var(--tc-navy);
}

.site-name a,
.url-text {
  color: var(--tc-blue);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.status.draft {
  color: #815f00;
  background: var(--soft-yellow);
}

.status.published {
  color: #096b3e;
  background: var(--soft-green);
}

.status.removed {
  color: #a41025;
  background: var(--soft-coral);
}

.empty-state {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  min-height: 100px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--tc-white);
  border: 1px solid var(--line);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.stat strong {
  display: block;
  margin-top: 8px;
  color: var(--tc-navy);
  font-size: 28px;
}

.create-layout,
.edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.file-drop {
  border: 1px dashed #9ecfdf;
  border-radius: var(--radius);
  padding: 18px;
  background: #f4fbfd;
  display: grid;
  gap: 12px;
}

.file-drop strong {
  color: var(--tc-navy);
}

.file-drop small,
.hint {
  color: var(--muted);
}

.resource-list,
.audit-list,
.version-list,
.credential-list {
  display: grid;
  gap: 10px;
}

.resource {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border-radius: var(--radius);
  background: #f7fafc;
  border: 1px solid var(--line);
}

.resource-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--soft-blue);
  color: var(--tc-blue);
  font-weight: 900;
}

.resource strong,
.audit-row strong,
.version-row strong,
.credential-row strong {
  display: block;
  color: var(--tc-navy);
}

.resource span,
.audit-row span,
.version-row span,
.credential-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.form-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.message {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: #f8fbfc;
  color: var(--tc-navy);
}

.message.error {
  background: var(--soft-coral);
  border-color: #ffc2ca;
  color: #9f1326;
}

.message.success {
  background: var(--soft-green);
  border-color: #baeeda;
  color: #096b3e;
}

.attributes {
  display: grid;
  gap: 10px;
}

.attribute-row {
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.attribute-row:last-child {
  border-bottom: 0;
}

.attribute-row span {
  color: var(--muted);
  font-size: 13px;
}

.attribute-row strong {
  color: var(--tc-navy);
  text-align: right;
  overflow-wrap: anywhere;
}

.actions-row {
  flex-wrap: wrap;
  gap: 10px;
}

.tabs {
  display: grid;
  gap: 16px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fafc;
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 7px 12px;
  color: var(--muted);
  font-weight: 800;
}

.segmented button.active {
  background: var(--tc-white);
  color: var(--tc-navy);
  box-shadow: 0 4px 12px rgba(45, 52, 61, 0.08);
}

.audit-row,
.version-row,
.credential-row {
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfe;
}

.timeline-marker {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tc-blue);
  flex: 0 0 auto;
}

.timeline-main {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 20px;
  align-items: start;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--tc-navy);
  font-size: 12px;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 25, 31, 0.5);
  z-index: 10;
}

.modal {
  width: min(100%, 520px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--tc-white);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal h2 {
  font-size: 26px;
  color: var(--tc-navy);
  margin-bottom: 16px;
}

.modal.hidden {
  display: none;
}

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

.access-warning {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--soft-yellow);
  color: #725600;
  border: 1px solid #f4df7a;
}

.mobile-only {
  display: none;
}

@media (max-width: 1060px) {
  .content-grid,
  .create-layout,
  .edit-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

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

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

  .login-brand {
    min-height: auto;
    padding: 28px 22px;
    gap: 44px;
  }

  .login-copy h1 {
    font-size: 42px;
  }

  .login-panel {
    padding: 20px;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
  }

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

  .main {
    padding: 20px 16px 36px;
  }

  .topbar,
  .page-title,
  .filters,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .page-title h1 {
    font-size: 34px;
  }

  .filters-left,
  .demo-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .site-cell {
    grid-template-columns: 92px minmax(160px, 1fr);
  }

  .thumb {
    width: 92px;
  }
}
