/* Company OS shell layout. Colors come only from --rtc-* tokens. */

.cos-boot {
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--rtc-space-3);
  color: var(--rtc-text-secondary);
}

.cos-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--rtc-space-6);
  padding: var(--rtc-space-6);
  background: var(--rtc-bg-nav);
  color: var(--rtc-text-on-nav);
}

.cos-login__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--rtc-space-2);
  text-align: center;
}

.cos-login__brand img { height: 28px; width: auto; }

.cos-login__tag {
  margin: 0;
  color: var(--rtc-text-on-nav-muted);
}

.cos-login__card { width: min(420px, 100%); }

.cos-login__card .rtc-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--rtc-space-4);
}

.cos-login__actions {
  display: flex;
  flex-direction: column;
  gap: var(--rtc-space-2);
}

.cos-login__actions .rtc-btn { width: 100%; }

.cos-nav-toggle { display: none; }

@media (max-width: 1023px) {
  .cos-nav-toggle { display: inline-flex; }
  .rtc-app[data-nav-open="true"]::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--rtc-bg-inverse);
    opacity: 0.48;
    z-index: calc(var(--rtc-z-drawer) - 1);
  }
}

.rtc-sidebar .cos-nav-btn {
  --_fg: var(--rtc-text-on-nav);
  --_bg: transparent;
  --_bd: transparent;
  --_bg-hover: var(--rtc-bg-nav-hover);
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  gap: var(--rtc-space-2);
  padding-inline: var(--rtc-space-3);
}

.rtc-sidebar .cos-signout {
  justify-content: flex-start;
}

.rtc-sidebar__foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--rtc-space-1);
}

.cos-user {
  padding: var(--rtc-space-1) var(--rtc-space-3);
  color: var(--rtc-text-on-nav-muted);
  font-size: var(--rtc-text-caption-size);
  line-height: var(--rtc-text-caption-line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.cos-bell { position: relative; }

.cos-bell--attention,
.cos-bell--attention .rtc-icon { color: var(--rtc-accent); }

.cos-bell__count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 16px;
}

.cos-anchor { position: relative; }

.cos-pop {
  position: absolute;
  top: calc(100% + var(--rtc-space-2));
  right: 0;
  width: min(360px, calc(100vw - 32px));
  max-height: 420px;
  overflow: auto;
  z-index: var(--rtc-z-dropdown);
}

.cos-pop__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  height: auto;
  padding: var(--rtc-space-2);
  white-space: normal;
}

.cos-pop__item[data-unread] { box-shadow: inset 3px 0 0 var(--rtc-accent); }

.cos-crumb { display: inline-flex; align-items: center; gap: var(--rtc-space-1); }

.cos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--rtc-gap);
}

.cos-card-link {
  display: flex;
  flex-direction: column;
  gap: var(--rtc-space-2);
  padding: var(--rtc-space-4);
  color: inherit;
  text-decoration: none;
}

.cos-card-link:hover { text-decoration: none; background: var(--rtc-bg-hover); }

.cos-wiki {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: var(--rtc-gap);
  align-items: start;
}

@media (max-width: 900px) {
  .cos-wiki { grid-template-columns: minmax(0, 1fr); }
}

.cos-wiki__tree {
  position: sticky;
  top: var(--rtc-space-4);
  max-height: calc(100vh - var(--rtc-topbar-height) - var(--rtc-footer-height) - var(--rtc-space-8));
  overflow: auto;
}

.cos-tree__row {
  display: flex;
  align-items: center;
  gap: var(--rtc-space-1);
  min-height: 32px;
  border-radius: var(--rtc-radius-md);
}

.cos-tree__link {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: var(--rtc-space-1) var(--rtc-space-2);
  border-radius: var(--rtc-radius-sm);
  color: var(--rtc-text-primary);
  text-decoration: none;
}

.cos-tree__link:hover { background: var(--rtc-bg-hover); text-decoration: none; }

.cos-tree__link[aria-current="page"] {
  background: var(--rtc-bg-selected);
  font-weight: 600;
}

.cos-tree__spacer { width: var(--rtc-control-height-sm); flex: none; }

.cos-space-btn {
  width: 100%;
  justify-content: flex-start;
}

.cos-space-btn[aria-current="page"] { background: var(--rtc-bg-selected); }

.cos-title-input {
  font: var(--rtc-text-h1-weight) var(--rtc-text-h1-size) / var(--rtc-text-h1-line) var(--rtc-text-h1-family);
  letter-spacing: var(--rtc-text-h1-tracking);
  height: auto;
  padding: var(--rtc-space-2) var(--rtc-space-3);
  border-color: transparent;
  background: transparent;
}

.cos-title-input:hover,
.cos-title-input:focus {
  border-color: var(--rtc-border-control);
  background: var(--rtc-bg-surface);
}

.cos-editor {
  min-height: 320px;
  padding: var(--rtc-space-4);
  border: 1px solid var(--rtc-border-default);
  border-radius: var(--rtc-radius-md);
  background: var(--rtc-bg-surface);
  color: var(--rtc-text-primary);
}

.cos-editor:focus { outline: none; box-shadow: var(--rtc-focus-ring); }

.cos-editor h1 {
  font: var(--rtc-text-h1-weight) var(--rtc-text-h1-size) / var(--rtc-text-h1-line) var(--rtc-text-h1-family);
  letter-spacing: var(--rtc-text-h1-tracking);
}

.cos-editor h2 {
  font: var(--rtc-text-h2-weight) var(--rtc-text-h2-size) / var(--rtc-text-h2-line) var(--rtc-text-h2-family);
}

.cos-editor h3 {
  font: var(--rtc-text-h3-weight) var(--rtc-text-h3-size) / var(--rtc-text-h3-line) var(--rtc-text-h3-family);
}

.cos-editor a { color: var(--rtc-text-link); }

.cos-editor--readonly { min-height: 0; }

.cos-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--rtc-space-1);
  padding: var(--rtc-space-2);
  border: 1px solid var(--rtc-border-default);
  border-radius: var(--rtc-radius-md);
  background: var(--rtc-bg-subtle);
}

.cos-toolbar .rtc-select { width: auto; min-width: 140px; }

.cos-check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--rtc-space-2); }

.cos-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  gap: var(--rtc-gap);
  overflow-x: auto;
  align-items: start;
  padding-bottom: var(--rtc-space-2);
}

.cos-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--rtc-bg-subtle);
  border: 1px solid var(--rtc-border-default);
  border-radius: var(--rtc-radius-lg);
  min-height: 240px;
}

.cos-column--over { box-shadow: inset 0 0 0 2px var(--rtc-border-focus); }

.cos-column__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rtc-space-2);
  padding: var(--rtc-space-3);
  border-bottom: 1px solid var(--rtc-border-default);
}

.cos-column__body {
  display: flex;
  flex-direction: column;
  gap: var(--rtc-space-2);
  padding: var(--rtc-space-2);
  min-height: 160px;
}

.cos-issue {
  display: flex;
  flex-direction: column;
  gap: var(--rtc-space-2);
  padding: var(--rtc-space-3);
  background: var(--rtc-bg-surface);
  border: 1px solid var(--rtc-border-default);
  border-radius: var(--rtc-radius-md);
  box-shadow: var(--rtc-shadow-1);
  cursor: grab;
  text-align: left;
  color: inherit;
  width: 100%;
}

.cos-issue:hover { background: var(--rtc-bg-hover); }

.cos-issue:active { cursor: grabbing; }

.cos-dragging { opacity: 0.55; }

.cos-issue__key {
  font-family: var(--rtc-font-family-mono);
  font-size: var(--rtc-text-caption-size);
  color: var(--rtc-text-secondary);
}

.cos-issue .rtc-select {
  height: var(--rtc-control-height-sm);
  font-size: var(--rtc-text-caption-size);
}

.cos-flip { transform: rotate(180deg); }

.cos-palette-layer {
  position: fixed;
  z-index: var(--rtc-z-modal);
  left: 50%;
  top: 12vh;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
}

.cos-palette-layer .rtc-palette { width: 100%; }

.cos-palette-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--rtc-text-primary);
  font: inherit;
  font-size: 16px;
  height: 100%;
}

.cos-palette-input:focus-visible { box-shadow: none; }

[aria-pressed="true"].cos-toggle { color: var(--rtc-text-brand); }

.cos-comment {
  display: flex;
  flex-direction: column;
  gap: var(--rtc-space-1);
  padding-bottom: var(--rtc-space-3);
  border-bottom: 1px solid var(--rtc-border-default);
}

.cos-comment:last-child { border-bottom: 0; }

.cos-prose p { margin: 0; }

.rtc-main__inner { width: 100%; }

/* Document workspace */
.cos-doc-toolbar {
  display: flex;
  gap: var(--rtc-space-2);
  margin-bottom: var(--rtc-space-3);
}
.cos-doc-editor {
  min-height: 320px;
  padding: var(--rtc-space-4);
  border: 1px solid var(--rtc-border-default);
  border-radius: var(--rtc-radius-md);
  background: var(--rtc-bg-surface);
  color: var(--rtc-text-primary);
}
.cos-doc-editor:focus-visible {
  outline: 2px solid var(--rtc-focus-ring);
  outline-offset: 2px;
}
.cos-sheet__cell {
  min-width: 5rem;
  font-variant-numeric: tabular-nums;
}
.cos-pdf-embed {
  width: 100%;
  min-height: 480px;
  border: 1px solid var(--rtc-border-default);
  border-radius: var(--rtc-radius-md);
}
.cos-slide {
  display: flex;
  flex-direction: column;
  gap: var(--rtc-space-2);
  padding: var(--rtc-space-3);
  border: 1px solid var(--rtc-border-default);
  border-radius: var(--rtc-radius-md);
  background: var(--rtc-bg-subtle);
}

/* Trello boards */
.cos-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--rtc-space-4);
}
.cos-board-tile {
  text-decoration: none;
  color: inherit;
  background: var(--rtc-bg-subtle);
}
.cos-trello {
  display: flex;
  gap: var(--rtc-space-4);
  overflow-x: auto;
  padding-bottom: var(--rtc-space-4);
  align-items: flex-start;
}
.cos-trello__list {
  flex: 0 0 17rem;
  background: var(--rtc-bg-subtle);
  border-radius: var(--rtc-radius-md);
  border: 1px solid var(--rtc-border-default);
  padding: var(--rtc-space-3);
  display: flex;
  flex-direction: column;
  gap: var(--rtc-space-2);
  min-height: 12rem;
}
.cos-trello__list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--rtc-space-2);
}
.cos-trello__cards {
  display: flex;
  flex-direction: column;
  gap: var(--rtc-space-2);
  min-height: 2rem;
}
.cos-trello__card {
  background: var(--rtc-bg-surface);
  border: 1px solid var(--rtc-border-default);
  border-radius: var(--rtc-radius-sm);
  padding: var(--rtc-space-3);
  cursor: grab;
}
.cos-trello__card:focus-visible {
  outline: 2px solid var(--rtc-focus-ring);
  outline-offset: 2px;
}
.cos-trello__title {
  color: var(--rtc-text-primary);
  text-decoration: none;
  font-weight: 600;
}
.cos-trello__labels {
  display: flex;
  flex-wrap: wrap;
  gap: var(--rtc-space-1);
  margin-bottom: var(--rtc-space-1);
}
.cos-trello__add,
.cos-trello__add-list {
  justify-content: flex-start;
}
.cos-grid--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--rtc-space-4);
}
@media (max-width: 800px) {
  .cos-grid--2 { grid-template-columns: 1fr; }
}
