/* App shell */

.os-shell {
  display: flex;
  min-height: 100vh;
}

.os-sidebar {
  flex: 0 0 var(--os-sidebar-width);
  width: var(--os-sidebar-width);
  max-width: 100%;
  background: var(--os-surface);
  color: var(--os-text);
  display: flex;
  flex-direction: column;
  padding: var(--os-space-4) var(--os-space-3);
  gap: var(--os-space-4);
  border-right: 1px solid var(--os-border);
}

.os-brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--os-text);
  text-decoration: none;
  padding: var(--os-space-1) var(--os-space-2);
  border-radius: var(--os-radius-sm);
}

.os-brand:hover {
  color: var(--os-text);
  background: var(--os-nav-hover-bg);
}

.os-brand-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 140px;
}

.os-nav-divider {
    height: 1px;
    margin: 0.35rem 0.5rem;
    background: var(--os-border, #e2e8f0);
}

.os-nav-link-muted {
    opacity: 0.72;
    font-size: 0.92rem;
}

.os-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.os-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--os-nav-text);
  text-decoration: none;
  padding: 0.5rem var(--os-space-3);
  border-radius: var(--os-radius-sm);
  font-size: var(--os-font-size-sm);
  font-weight: 600;
  line-height: 1.25;
}

.os-nav-link:hover {
  color: var(--os-nav-hover-text);
  background: var(--os-nav-hover-bg);
}

.os-nav-link:hover .os-nav-icon {
  color: var(--os-nav-hover-text);
}

.os-nav-link-active,
.os-nav-link[aria-current="page"] {
  color: var(--os-nav-active-text);
  background: var(--os-nav-active-bg);
}

.os-nav-link-active .os-nav-icon,
.os-nav-link[aria-current="page"] .os-nav-icon {
  color: var(--os-nav-active-text);
}

.os-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: var(--os-nav-icon);
}

.os-nav-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.os-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.os-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--os-bg);
}

.os-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--os-space-3);
  min-height: var(--os-topbar-height);
  padding: var(--os-space-3) var(--os-space-5);
  background: var(--os-surface);
  border-bottom: 1px solid var(--os-border);
  box-shadow: none;
}

.os-topbar__lead {
  min-width: 0;
  flex: 1 1 12rem;
}

.os-topbar__kicker {
  margin: 0 0 var(--os-space-1);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--os-text-soft);
}

.os-topbar__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--os-text);
  line-height: var(--os-line-tight);
}

/*
 * Remove visual duplicate titles when an in-page shell already states the route
 * (job details supplies its own headings). Does not suppress text for SR when used
 * on a semantic heading; paired with duplicate/presentation elements only.
 */
.os-layout-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap !important;
  border: 0 !important;
}

.os-topbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--os-space-2);
}

.os-content {
  flex: 1;
  padding: var(--os-space-5) var(--os-space-6);
  min-width: 0;
  width: 100%;
  max-width: var(--os-content-max-width);
}

/*
 * Content shell types (set on <main class="os-content"> in _Layout.cshtml):
 *
 * A. Workspace — .os-content--workspace
 *    Bounded left-aligned surface for list/register/form pages (max --os-workspace-max-width).
 *
 * B. Full-width — no workspace class, or .os-content--workflow-full
 *    Planering/Calendar and Workflow kanban use the full main column.
 *
 * C. Detail — usually workspace shell; inner .os-page may define its own grid/max-width.
 */

/* A. Workspace shell */
.os-content.os-content--workspace {
  max-width: min(100%, var(--os-workspace-max-width));
  margin-left: 0;
  margin-right: auto;
}

/* B. Full-width shell (Workflow board) */
.os-content.os-content--workflow-full {
  max-width: none;
}

.os-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

.os-page--wide {
  width: 100%;
  max-width: var(--os-content-wide-max-width);
  margin: 0;
}

.os-page--full-width {
  max-width: none;
  width: 100%;
  margin: 0;
}

.os-page-heading {
  display: grid;
  gap: var(--os-space-2);
  min-width: 0;
}

.os-page-title {
  margin: 0;
  font-size: clamp(1.25rem, 1vw + 1rem, 1.4rem);
  font-weight: 650;
  line-height: var(--os-line-tight);
  letter-spacing: -0.02em;
}

.os-page-subtitle {
  margin: 0;
  color: var(--os-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.os-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--os-space-4);
  margin-bottom: var(--os-space-5);
}

.os-page-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--os-space-2);
}

.os-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--os-space-4);
}

.os-workspace-main {
  min-width: 0;
}

.os-workspace-side {
  min-width: 0;
}

.os-grid {
  display: grid;
  gap: var(--os-space-4);
}

.os-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.os-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.os-footer {
  padding: var(--os-space-3) var(--os-space-5);
  font-size: var(--os-font-size-sm);
  font-weight: 500;
  color: var(--os-text-muted);
  border-top: 1px solid var(--os-border);
  background: var(--os-surface);
}

.os-footer a {
  color: var(--os-text-muted);
}

.os-footer-inner {
  max-width: none;
  margin: 0;
}

/* Mobile sidebar */
.os-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-right: var(--os-space-2);
  padding: 0;
  border: 1px solid var(--os-border);
  border-radius: var(--os-radius-sm);
  background: var(--os-surface-soft);
  color: var(--os-text);
  cursor: pointer;
  flex-shrink: 0;
}

.os-sidebar-toggle:hover {
  background: var(--os-border);
}

.os-topbar__lead-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

/* Public status layout (no platform chrome) */
.os-public-wrap {
  max-width: 26rem;
  margin: 0 auto;
  padding: var(--os-space-5) var(--os-space-4);
}

.os-public-footer {
  text-align: center;
  font-size: var(--os-font-size-sm);
  font-weight: 500;
  color: var(--os-text-muted);
  padding: var(--os-space-6) var(--os-space-4) var(--os-space-4);
}

@media (max-width: 900px) {
  .os-sidebar-toggle {
    display: inline-flex;
  }

  .os-shell {
    flex-direction: column;
  }

  .os-sidebar {
    position: fixed;
    z-index: 200;
    top: 0;
    left: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--os-shadow-md);
  }

  body.os-sidebar-open .os-sidebar {
    transform: translateX(0);
  }

  .os-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(15, 23, 42, 0.35);
  }

  body.os-sidebar-open .os-sidebar-backdrop {
    display: block;
  }

  .os-main {
    width: 100%;
  }

  .os-content,
  .os-content.page,
  .page.os-content {
    padding: var(--os-space-4);
  }

  .os-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .os-grid-2,
  .os-grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .os-workspace {
    grid-template-columns: minmax(0, 1fr) 22rem;
    align-items: start;
  }
}
