:root {
  font-size: 14px;
}

button {
  min-height: 32px;
  padding: 0 11px;
  border-radius: 6px;
}

input,
textarea,
select {
  padding: 8px 10px;
  border-radius: 6px;
}

select {
  width: 100%;
  border: 1px solid #3a4f74;
  background: #17233a;
  color: #edf3ff;
}

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

.sidebar {
  gap: 16px;
  padding: 10px 7px;
}

.brand {
  justify-content: center;
  padding: 0;
}

.brand > span:last-child,
.sidebar-footer,
.nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.navigation {
  width: 100%;
  gap: 4px;
  justify-items: center;
}

.nav-item {
  display: grid;
  margin-inline: auto;
  place-items: center;
  width: 40px;
  min-height: 40px;
  padding: 0;
  line-height: 0;
}

.nav-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
}

.main-area {
  grid-template-rows: 52px minmax(0, 1fr);
}

.topbar {
  gap: 14px;
  padding: 0 16px;
}

.content-wrap {
  padding: 12px;
}

#hub-dashboard {
  min-height: calc(100vh - 76px);
}

.page-heading,
.section-heading {
  gap: 12px;
  margin-bottom: 12px;
}

.page-heading h1,
.section-heading h1 {
  font-size: 21px;
}

.workspace-card {
  padding: 14px;
  border-radius: 9px;
}

.workspace-actions,
.dialog-actions {
  gap: 6px;
}

.inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.policy-summary {
  padding: 9px 10px;
  border: 1px solid #2f4261;
  border-radius: 6px;
  background: #0d1829;
  color: #afbdd3;
  font-size: 12px;
  line-height: 1.5;
}

.agent-choice-list,
.usage-cards {
  display: grid;
  gap: 7px;
}

.agent-list {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 10px;
}

.agent-item {
  gap: 11px;
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
}

.agent-item-header,
.agent-actions,
.agent-projects,
.agent-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-item-header {
  justify-content: space-between;
  gap: 10px;
}

.agent-item-header strong {
  font-size: 15px;
}

.agent-status-badge,
.agent-meta span,
.agent-projects span {
  padding: 3px 7px;
  border: 1px solid #344c70;
  border-radius: 999px;
  color: #bfd0e8;
  font-size: 11px;
  line-height: 1.35;
}

.agent-status-badge.is-ready,
.agent-meta .is-cli-ready {
  border-color: #2b7253;
  background: #173d31;
  color: #8ee0b7;
}

.agent-status-badge.needs-setup,
.agent-meta .is-cli-missing {
  border-color: #75583a;
  background: #3d2c1d;
  color: #e7c28d;
}

.agent-description {
  min-height: 42px;
}

.agent-projects {
  min-height: 24px;
  color: #91a2bb;
  font-size: 11px;
}

.agent-projects span {
  border-color: #30415f;
  background: #101b2d;
}

.agent-actions {
  margin-top: 2px;
}

.agent-actions button {
  min-height: 30px;
  font-size: 12px;
}

.agent-choice {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.usage-layout {
  display: grid;
  gap: 10px;
}

.usage-cards {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.usage-card,
.usage-totals {
  padding: 10px;
  border: 1px solid #2f4261;
  border-radius: 7px;
  background: #15243a;
}

.usage-card p {
  margin: 5px 0 0;
  color: #afbdd3;
  font-size: 12px;
}

.usage-totals {
  margin-top: 8px;
  font-size: 13px;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr)) auto;
  gap: 6px;
  max-width: none;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.filter-bar input,
.filter-bar select {
  min-width: 0;
  height: 32px;
}

.audit-scroll {
  overflow: auto;
  border: 1px solid #263752;
  border-radius: 7px;
}

.audit-table {
  min-width: 850px;
}

.audit-table .file-row {
  cursor: pointer;
}

.chat-layout {
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
  border-radius: 9px;
}

.chat-workspace {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-sidebar {
  padding: 11px;
}

.chat-sidebar-heading {
  gap: 6px;
  margin-bottom: 10px;
}

.chat-header {
  min-height: 42px;
  padding: 6px 12px;
}

.conversation-messages {
  padding-top: 12px;
  padding-bottom: 12px;
}

.message {
  margin-bottom: 12px;
}

#conversation-composer {
  padding: 8px 12px;
}

.project-picker {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.project-picker .project-button {
  min-height: 42px;
  padding: 7px 10px;
}

.file-manager {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: calc(100vh - 76px);
  overflow: hidden;
  border: 1px solid #30415f;
  border-radius: 8px;
  background: #111d31;
}

.file-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px;
  overflow-x: auto;
  border-bottom: 1px solid #2b3c58;
  background: #121c2d;
}

.file-toolbar .icon-button {
  flex: 0 0 32px;
  width: 32px;
  padding: 0;
  font-size: 18px;
}

.file-toolbar .secondary-button,
.file-toolbar .upload-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
}

.file-address {
  flex: 1 1 280px;
  min-width: 180px;
  height: 32px;
}

.file-layout {
  display: grid;
  grid-template-columns: 190px minmax(360px, 1fr) minmax(240px, 32%);
  min-height: 0;
}

.file-navigation,
.file-list-pane,
.file-preview {
  min-width: 0;
  overflow: auto;
}

.file-navigation {
  padding: 10px 7px;
  border-right: 1px solid #2b3c58;
  background: #101827;
}

.file-navigation > strong {
  display: block;
  padding: 0 7px 8px;
}

#file-navigation-tree {
  display: grid;
  gap: 2px;
}

.folder-tree-item {
  justify-content: flex-start;
  min-height: 28px;
  padding: 0 6px 0 calc(6px + var(--depth) * 12px);
  overflow: hidden;
  border-color: transparent;
  background: transparent;
  color: #cbd6e8;
  font-weight: 500;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-tree-item:hover,
.folder-tree-item.is-current {
  background: #1a2b47;
}

.workspace-location {
  margin: 0;
  padding: 7px 10px;
  overflow: hidden;
  border-bottom: 1px solid #263752;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-details {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.file-details th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 30px;
  padding: 0 8px;
  border-bottom: 1px solid #30415f;
  background: #121c2d;
  color: #afbdd3;
  font-weight: 600;
  text-align: left;
}

.file-details th:first-child {
  width: 44%;
}

.file-details th:nth-child(2) {
  width: 16%;
}

.file-details th:nth-child(3) {
  width: 26%;
}

.file-details th:last-child {
  width: 14%;
}

.file-row {
  display: table-row;
  outline: none;
}

.file-row td {
  height: 30px;
  padding: 0 8px;
  overflow: hidden;
  border-bottom: 1px solid #1e2e47;
  color: #cbd6e8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row:hover td,
.file-row.is-selected td,
.file-row:focus td {
  background: #1b3152;
}

.file-row.is-selected td {
  box-shadow: inset 0 1px #4779d5, inset 0 -1px #4779d5;
}

.file-name {
  color: #edf3ff !important;
}

.file-empty {
  padding: 24px !important;
  color: #91a2bb;
  text-align: center;
}

.file-preview {
  border-left: 1px solid #2b3c58;
  background: #0c1525;
}

.file-preview header {
  height: 34px;
  padding: 8px 10px;
  border-bottom: 1px solid #263752;
  background: #121c2d;
}

.file-preview pre {
  margin: 0;
  padding: 11px;
  color: #cbd6e8;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}

.file-manager.is-preview-hidden .file-layout {
  grid-template-columns: 190px minmax(360px, 1fr);
}

.file-manager.is-preview-hidden .file-preview {
  display: none;
}

.file-status {
  min-height: 27px;
  padding: 5px 9px;
  border-top: 1px solid #2b3c58;
  color: #91a2bb;
  font-size: 11px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.git-preview-dialog .login-dialog-content {
  width: min(620px, calc(100vw - 28px));
  gap: 10px;
}

.git-preview-summary {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 6px 10px;
  padding: 10px;
  border: 1px solid #2b3c58;
  border-radius: 8px;
  background: #101b2d;
  font-size: 12px;
}

.git-preview-summary span {
  color: #91a2bb;
}

.git-preview-summary strong {
  overflow-wrap: anywhere;
}

#git-preview-files {
  max-height: 210px;
  margin: 0;
  padding: 8px 8px 8px 28px;
  overflow: auto;
  border: 1px solid #2b3c58;
  border-radius: 8px;
  background: #0c1525;
  color: #cbd6e8;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}

#git-preview-error:empty {
  display: none;
}

.deployment-card {
  display: grid;
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
}

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

.deployment-summary article,
.deployment-confirmation {
  padding: 12px;
  border: 1px solid #2b3c58;
  border-radius: 10px;
  background: #101b2d;
}

.deployment-summary span {
  display: block;
  margin-bottom: 5px;
  color: #91a2bb;
  font-size: 11px;
}

.deployment-summary strong {
  overflow-wrap: anywhere;
}

.deployment-target {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.deployment-target label {
  display: grid;
  gap: 5px;
  color: #afbdd3;
  font-size: 12px;
}

.deployment-confirmation h2,
.deployment-confirmation h3,
.deployment-confirmation p {
  margin: 0 0 8px;
}

.deployment-confirmation h3 {
  color: #afbdd3;
  font-size: 12px;
}

#deployment-changed-files {
  max-height: 150px;
  margin: 0 0 12px;
  padding-left: 20px;
  overflow: auto;
  color: #cbd6e8;
  font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
}

#deployment-error:empty {
  display: none;
}

.deployment-history th:first-child {
  width: 30%;
}

.deployment-history th:nth-child(2) {
  width: 25%;
}

.deployment-history th:nth-child(3) {
  width: 25%;
}

.deployment-history th:last-child {
  width: 20%;
}

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

  .file-layout {
    grid-template-columns: 150px minmax(300px, 1fr);
  }

  .file-preview {
    display: none;
  }

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

@media (max-width: 700px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    padding: 6px 8px;
  }

  .nav-label {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
  }

  .nav-item {
    display: flex;
    margin-inline: 0;
    width: auto;
    padding: 0 9px;
    gap: 5px;
    font-size: 12px;
  }

  .file-manager {
    min-height: calc(100vh - 126px);
  }

  .file-layout,
  .file-manager.is-preview-hidden .file-layout {
    grid-template-columns: 1fr;
  }

  .file-navigation {
    display: none;
  }

  .deployment-target {
    grid-template-columns: 1fr;
  }
}
