/*
 * Final shell regression guard.
 * This file intentionally loads last so navigation text, time visibility, and
 * Calendar geometry cannot be re-broken by older responsive rules.
 */

.layout.os-layout-v10 {
  --sidebar: 272px;
}

.layout.os-layout-v10 .nav-group-toggle,
.layout.os-layout-v10 .nav-item,
.layout.os-layout-v10 .nav-subitem {
  height: auto;
}

.layout.os-layout-v10 .nav-group-toggle {
  min-height: 42px;
}

.layout.os-layout-v10 .nav-item {
  min-height: 40px;
  padding-block: 7px;
}

.layout.os-layout-v10 .nav-subitem {
  min-height: 34px;
}

.layout.os-layout-v10 .nav-footer .license-pill {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  justify-content: stretch;
  gap: 4px;
  padding: 9px 10px;
}

.layout.os-layout-v10 .nav-footer .license-pill b,
.layout.os-layout-v10 .nav-footer .license-pill small {
  width: 100%;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
  text-align: left;
}

.layout.os-layout-v10 .nav-footer .license-pill small {
  font-size: 9px;
}

.layout.os-layout-v10 .nav-group-toggle strong,
.layout.os-layout-v10 .nav-module-node.module-color-scope .nav-item > span:not(.module-nav-icon),
.layout.os-layout-v10 .nav-subitem > span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.layout.os-layout-v10 .workspace-tab-list {
  scroll-behavior: smooth;
}

.layout.os-layout-v10 .workspace-tab-group {
  flex: 0 0 auto;
  width: max-content;
  min-width: max-content;
  max-width: none;
}

.layout.os-layout-v10 .workspace-tab {
  width: max-content;
  min-width: max-content;
  max-width: none;
  grid-template-columns: 18px auto;
}

.layout.os-layout-v10 .workspace-tab span,
.layout.os-layout-v10 .workspace-tab small {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.current-time-chip {
  min-width: 128px;
  height: 38px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 7%, transparent), color-mix(in srgb, var(--teal) 6%, transparent)),
    var(--surface);
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.current-time-chip .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--primary);
}

.current-time-chip > span {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1;
}

.current-time-chip strong {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.current-time-chip small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

html[data-theme="dark"] .current-time-chip {
  border-color: color-mix(in srgb, var(--primary) 28%, rgba(139, 158, 204, 0.2));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 13%, transparent), color-mix(in srgb, var(--teal) 8%, transparent)),
    #090f20;
  color: #f4f7ff;
}

html[data-theme="dark"] .current-time-chip .icon {
  color: #8fa7ff;
}

@media (max-width: 1500px) {
  .layout.os-layout-v10 {
    --sidebar: 260px;
  }
}

@media (max-width: 1360px) {
  .layout.os-layout-v10 .calendar-side-panel {
    display: none;
  }

  .layout.os-layout-v10 .calendar-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) {
  .layout.os-layout-v10 {
    --sidebar: 0px;
  }

  .layout.os-layout-v10 > .sidebar {
    width: min(300px, calc(100vw - 44px));
  }
}

@media (max-width: 900px) {
  .layout.os-layout-v10 .workspace-tab-group {
    width: max-content;
    min-width: max-content;
    max-width: none;
  }

  .current-time-chip {
    min-width: 80px;
    padding-inline: 8px;
  }

  .current-time-chip small {
    display: none;
  }
}

@media (max-width: 640px) {
  .current-time-chip {
    min-width: 68px;
    gap: 5px;
    padding-inline: 7px;
  }

  .current-time-chip .icon {
    display: none;
  }

  .current-time-chip strong {
    font-size: 11px;
  }
}

.notification-bell {
  position: relative;
  overflow: visible;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid var(--surface, #fff);
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(239, 68, 68, .3);
}

.notification-badge[hidden] {
  display: none;
}

.notification-center {
  position: fixed;
  z-index: 2200;
  top: 66px;
  right: 16px;
  display: none;
  width: min(410px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 86px));
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--primary) 22%);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 96%, var(--primary) 4%);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.notification-center.is-open {
  display: flex;
  flex-direction: column;
  animation: notification-center-in .16s ease-out;
}

@keyframes notification-center-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notification-center-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 14%, transparent), transparent 52%),
    var(--surface);
}

.notification-center-head h3 {
  margin: 2px 0;
  font-size: 20px;
}

.notification-center-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.notification-center-list {
  min-height: 140px;
  overflow: auto;
  padding: 8px;
}

.notification-center-item {
  position: relative;
  border: 1px solid transparent;
  border-radius: 14px;
}

.notification-center-item + .notification-center-item {
  margin-top: 4px;
}

.notification-center-item.is-unread {
  border-color: color-mix(in srgb, var(--primary) 25%, var(--line));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.notification-center-open {
  display: grid;
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr) 8px;
  align-items: start;
  gap: 10px;
  padding: 12px 44px 12px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.notification-center-open:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-radius: 13px;
}

.notification-center-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--primary) 13%, var(--surface));
  color: var(--primary);
}

.notification-center-icon .icon {
  width: 17px;
  height: 17px;
}

.notification-center-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.notification-center-copy strong,
.notification-center-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-center-copy strong {
  font-size: 13px;
  white-space: nowrap;
}

.notification-center-copy span {
  display: -webkit-box;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-center-copy small {
  color: var(--muted);
  font-size: 9px;
}

.notification-center-open i {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

.notification-mark-read {
  position: absolute;
  top: 12px;
  right: 10px;
}

.notification-center-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.notification-center-empty .icon {
  width: 26px;
  height: 26px;
  color: var(--primary);
}

.notification-center-empty strong {
  color: var(--text);
}

html[data-theme="dark"] .notification-center {
  background: #0b1224;
  border-color: #263553;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
}

html[data-theme="dark"] .notification-center-head {
  background:
    radial-gradient(circle at top right, rgba(78, 112, 255, .2), transparent 52%),
    #0b1224;
}

html[data-theme="dark"] .notification-badge {
  border-color: #080f20;
}

@media (max-width: 640px) {
  .notification-center {
    top: 58px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: calc(100vh - 70px);
    border-radius: 16px;
  }

  .notification-center-head {
    padding: 14px;
  }
}

/* Stable team identity colors keep ownership visible across every module. */
html .avatar.is-person-color {
  border-color: hsl(var(--person-h) 66% 38% / .34);
  background: linear-gradient(145deg, hsl(var(--person-h) 78% 54%), hsl(var(--person-h) 72% 38%));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .34),
    0 6px 16px hsl(var(--person-h) 70% 38% / .2);
}

html[data-theme="dark"] .avatar.is-person-color {
  border-color: hsl(var(--person-h) 78% 66% / .34);
  background: linear-gradient(145deg, hsl(var(--person-h) 74% 52%), hsl(var(--person-h) 70% 34%));
  color: #fff;
}

.task-user-tags {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  overflow: hidden;
}

.task-user-tag {
  min-width: 0;
  max-width: 92px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px 0 5px;
  flex: 0 1 auto;
  overflow: hidden;
  border: 1px solid hsl(var(--person-h) 68% 44% / .24);
  border-radius: 999px;
  background: hsl(var(--person-h) 78% 95%);
  color: hsl(var(--person-h) 72% 31%);
}

.task-user-tag i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: hsl(var(--person-h) 72% 44%);
  box-shadow: 0 0 0 3px hsl(var(--person-h) 76% 50% / .12);
}

.task-user-tag b {
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-user-tag.is-overflow,
.task-user-tag.is-unassigned {
  --person-h: 216;
  flex: 0 0 auto;
  color: var(--muted);
}

.task-card-premium {
  border-color: color-mix(in srgb, hsl(var(--task-owner-h) 72% 44%) 20%, var(--line));
  box-shadow:
    inset 0 2px 0 hsl(var(--task-owner-h) 72% 44% / .72),
    0 10px 28px rgba(15, 23, 42, .06);
}

.layout.os-layout-v10 .task-card-foot {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 7px;
}

.layout.os-layout-v10 .task-card-foot .task-user-tags {
  width: 100%;
}

html[data-theme="dark"] .task-user-tag {
  border-color: hsl(var(--person-h) 74% 62% / .26);
  background: hsl(var(--person-h) 58% 20% / .72);
  color: hsl(var(--person-h) 80% 82%);
}

html[data-theme="dark"] .task-card-premium {
  border-color: color-mix(in srgb, hsl(var(--task-owner-h) 76% 62%) 27%, #263553);
  box-shadow:
    inset 0 2px 0 hsl(var(--task-owner-h) 76% 62% / .72),
    0 14px 36px rgba(0, 0, 0, .28);
}

/* Record windows use a predictable grid so data and controls align as they resize. */
.record-window .panel-body {
  padding-inline: 14px;
}

.record-window .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  align-items: start;
  gap: 12px;
}

.record-window .form-grid > *,
.record-window .field,
.record-window .field > * {
  min-width: 0;
}

.record-window .field {
  align-content: start;
  gap: 6px;
}

.record-window .field input,
.record-window .field select {
  min-height: 40px;
  height: 40px;
}

.record-window .field textarea {
  min-height: 92px;
}

.record-window .people-picker {
  grid-template-columns: repeat(auto-fit, minmax(min(166px, 100%), 1fr));
  gap: 7px;
  padding: 7px;
}

.record-window .person-chip {
  min-height: 50px;
  padding: 7px 8px;
  border-radius: 13px;
}

.record-window .task-detail-hero {
  gap: 12px;
  padding: 14px;
}

.record-window .task-detail-actions,
.record-window .task-detail-context {
  padding-inline: 14px;
}

.record-window .task-detail-context {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  max-height: none;
}

.record-window .tab-row {
  gap: 4px;
  padding: 8px 14px 0;
}

.record-window .tab-row .tab {
  min-height: 38px;
  padding-inline: 11px;
}

.record-window .key-list {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  align-items: stretch;
}

.record-window .key-item,
.record-window .key-pill {
  min-width: 0;
}

@container (max-width: 520px) {
  .record-window .panel-body {
    padding-inline: 10px;
  }

  .record-window .form-grid,
  .record-window .task-detail-context,
  .record-window .key-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .record-window .task-detail-hero,
  .record-window .task-detail-actions,
  .record-window .task-detail-context,
  .record-window .tab-row {
    padding-inline: 10px;
  }

  .record-window .task-detail-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}
