.layout {
  display: grid;
  grid-template-columns: 234px 1fr;
  min-height: 100dvh;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 32px 19px 18px;
  position: fixed;
  inset: 0 auto 0 0;
  width: 234px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.sidebar .brand {
  padding: 0 13px;
  margin-bottom: 35px;
}
.company-picker {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 10px;
  background: var(--nav-surface);
  border-radius: 12px;
  margin: 0 4px 25px;
}
.company-picker select {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
}
.company-icon {
  background: var(--nav-icon);
  border-radius: 7px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
  flex-shrink: 0;
}
.nav-label {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: var(--muted);
  margin: 0 15px 11px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.nav-item.active {
  background: var(--nav-active);
  color: var(--blue);
  font-weight: 550;
}
.nav-item:hover {
  background: var(--nav-hover);
}
.nav-divider {
  border-top: 1px solid var(--line);
  margin: 19px 13px;
}
.nav-bottom {
  margin-top: auto;
}
.plan-card {
  padding: 15px;
  background: var(--plan-bg);
  border: 1px solid var(--plan-border);
  border-radius: 13px;
  margin: 20px 4px 14px;
}
.plan-card p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 7px;
}
.plan-card .badge {
  margin-top: 10px;
}
.sidebar-user {
  border-top: 1px solid var(--line);
  padding: 18px 7px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user strong {
  display: block;
  font-size: 11px;
}
.sidebar-user span {
  display: block;
  font-size: 10px;
  margin-top: 4px;
  color: var(--muted);
}
.main {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 38px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.breadcrumb {
  color: var(--muted);
}
.breadcrumb span {
  color: var(--text-strong);
  margin-left: 14px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 19px;
  margin-left: auto;
}
.topbar-date {
  color: var(--muted);
  font-size: 11px;
}
.workspace {
  padding: 34px 38px;
  max-width: 1700px;
  margin: auto;
}

.notifications-wrap {
  position: relative;
}

.notifications-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 360px;
  max-height: 480px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(31, 45, 61, 0.14);
  z-index: 50;
}

.notifications-dropdown[hidden] {
  display: none;
}

.notifications-dropdown-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.notifications-clear {
  margin-left: auto;
  flex-shrink: 0;
}

.notifications-dropdown-head strong {
  font-size: 13px;
  font-weight: 600;
}

.notifications-dropdown-list {
  max-height: 410px;
  overflow-y: auto;
}

.notifications-dropdown-loading {
  padding: 32px 20px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
#notifications-toggle {
  position: relative;
}

.notifications-badge {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--blue);
  border: 2px solid var(--surface);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
  box-sizing: border-box;
}

.notifications-badge[hidden] {
  display: none;
}
.notifications-dropdown .note-item {
  gap: 10px;
  padding: 14px 16px;
  align-items: flex-start;
}

.notifications-dropdown .note-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.notifications-dropdown .note-icon .icon {
  width: 17px;
  height: 17px;
}

.notifications-dropdown .note-item h3 {
  margin: 0 0 4px;
  font-size: 11px;
}

.notifications-dropdown .note-item p {
  margin: 0;
  font-size: 10px;
  line-height: 1.5;
}

.notifications-dropdown .text-link {
  flex-shrink: 0;
  align-self: center;
  font-size: 10px;
}

.notifications-dropdown-list {
  max-height: 360px;
}

.notifications-dropdown {
  max-height: 430px;
}

/* Company switcher */

.company-picker {
  position: relative;
  display: block;
  padding: 0;
  background: transparent;
}

.company-picker-toggle {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--nav-surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.company-picker-toggle:hover {
  background: var(--nav-hover);
}

.company-picker-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.company-picker-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.company-picker-chevron {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--muted);
}

.company-picker-chevron::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(-50%, -65%) rotate(45deg);
}

.company-picker-toggle[aria-expanded='true']
  .company-picker-chevron::before {
  transform: translate(-50%, -35%) rotate(225deg);
}

.company-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  overflow: hidden;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(31, 45, 61, 0.14);
  z-index: 60;
}

.company-dropdown[hidden] {
  display: none;
}

.company-option {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.company-option:hover {
  background: var(--surface-hover);
}

.company-option.active {
  background: var(--nav-active);
  color: var(--blue);
}

.company-option-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--nav-icon);
  color: var(--text-soft);
}

.company-option-icon .icon {
  width: 15px;
  height: 15px;
}

.company-option.active .company-option-icon {
  background: var(--shift-bg);
  color: var(--blue);
}

.company-option-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
}

.company-option-check {
  flex-shrink: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
}

/* Floating application shell */
@media (min-width: 801px) {
  .layout {
    grid-template-columns: 266px minmax(0, 1fr);
  }

  .sidebar {
    inset: 16px auto 16px 16px;
    width: 234px;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(31, 45, 61, 0.08);
  }

  .main {
    grid-column: 2;
  }
}

.topbar {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 30;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.topbar > * {
  pointer-events: auto;
}

.account-island {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 14px 38px rgba(31, 45, 61, 0.1);
}

.account-island .notifications-wrap {
  padding-right: 7px;
  border-right: 1px solid var(--line);
}

.account-island-profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 7px 3px 2px;
  border-radius: 11px;
  color: var(--text);
  text-decoration: none;
}

.account-island-profile:hover {
  background: var(--surface-hover);
}

.account-island-name {
  max-width: 150px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-island-chevron {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--muted);
}

.account-island-chevron::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(-65%, -50%) rotate(-45deg);
}

.workspace {
  padding-top: 92px;
}
