/* ==========================================================================
   K Dijital — application shell
   --------------------------------------------------------------------------
   The signed-in experience is a desktop application, not a website: a fixed
   title bar, a tab strip, a flush navigation panel, a scrolling work area and a
   status bar. Public marketing pages keep the existing site skin; every rule
   here is scoped to ``body.app-shell``.
   ========================================================================== */

body.app-shell {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: 48px 34px minmax(0, 1fr) 26px;
  background: var(--ui-bg);
}

body.app-shell > .navbar,
body.app-shell > .site-footer {
  display: none;
}

body.app-shell .layout {
  display: flex;
  gap: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

body.app-shell .content {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 22px 40px;
  scrollbar-gutter: stable;
  background:
    radial-gradient(1200px 500px at 15% -10%, rgba(37, 99, 235, 0.06), transparent 60%),
    radial-gradient(900px 460px at 90% 0%, rgba(249, 115, 22, 0.045), transparent 55%),
    var(--ui-bg);
}

/* --------------------------------------------------------------------------
   1. Title bar
   -------------------------------------------------------------------------- */

.appbar {
  position: relative;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 10px 0 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 70%),
    var(--ui-chrome-solid);
  border-bottom: 1px solid var(--ui-border);
  color: var(--ui-text);
  -webkit-app-region: drag;
}

.appbar__left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 0;
}

.appbar__right {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.appbar__icon {
  -webkit-app-region: no-drag;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.appbar__icon svg {
  width: 16px;
  height: 16px;
}

.appbar__icon:hover,
.appbar__icon:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--ui-border);
  color: var(--ui-text-strong);
  outline: none;
}

body.sidebar-collapsed .appbar__panel-toggle {
  background: var(--ui-accent-soft);
  border-color: var(--ui-accent-line);
  color: var(--ui-accent-bright);
}

.appbar__brand {
  -webkit-app-region: no-drag;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px 8px 2px 4px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}

.appbar__brand:hover {
  background: rgba(255, 255, 255, 0.05);
}

.appbar__brand img {
  width: 13px;
  height: auto;
  opacity: 0.95;
}

.appbar__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.appbar__brand-text strong {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: var(--ui-text-strong);
}

.appbar__brand-text small {
  font-size: 0.63rem;
  color: var(--ui-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appbar__divider {
  width: 1px;
  height: 18px;
  background: var(--ui-border);
  flex: 0 0 auto;
}

.appbar__workspace {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ui-text);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--ui-border-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appbar__workspace-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ui-green);
  box-shadow: 0 0 7px rgba(52, 211, 153, 0.8);
  flex: 0 0 auto;
}

.appbar__search {
  -webkit-app-region: no-drag;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 460px;
  height: 30px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--ui-border);
  border-radius: 7px;
  background: var(--ui-field);
  color: var(--ui-text-muted);
  font: inherit;
  font-size: 0.74rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.appbar__search:hover,
.appbar__search:focus-visible {
  border-color: var(--ui-border-strong);
  background: var(--ui-surface-2);
  box-shadow: var(--ui-ring);
  outline: none;
}

.appbar__search svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.appbar__search-label {
  flex: 1 1 auto;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appbar__kbd,
.command__kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--ui-border);
  border-bottom-color: var(--ui-border-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--ui-text-faint);
  font-family: var(--ui-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   2. Account menu
   -------------------------------------------------------------------------- */

.app-user {
  position: relative;
  -webkit-app-region: no-drag;
}

.app-user__trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 3px 7px 3px 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.app-user__trigger::-webkit-details-marker {
  display: none;
}

.app-user__trigger:hover,
.app-user[open] .app-user__trigger {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--ui-border);
}

.app-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--ui-accent-bright), var(--ui-accent-deep));
  color: var(--ui-on-accent);
  font-size: 0.72rem;
  font-weight: 800;
  overflow: hidden;
  flex: 0 0 auto;
}

.app-user__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-user__avatar--lg {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.app-user__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
  text-align: left;
}

.app-user__name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--ui-text);
}

.app-user__meta {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.6rem;
  color: var(--ui-text-faint);
}

.app-user__caret {
  width: 0;
  height: 0;
  margin-left: 1px;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid var(--ui-text-faint);
}

.app-user__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 120;
  width: 254px;
  padding: 6px;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  background: var(--ui-surface-solid);
  box-shadow: var(--ui-shadow-3);
}

.app-user__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-bottom: 1px solid var(--ui-border-soft);
  margin-bottom: 5px;
}

.app-user__head strong {
  display: block;
  font-size: 0.78rem;
  color: var(--ui-text-strong);
}

.app-user__head small {
  display: block;
  font-size: 0.64rem;
  color: var(--ui-text-muted);
}

.app-user__group {
  padding: 4px 0;
  border-bottom: 1px solid var(--ui-border-soft);
}

.app-user__group:last-of-type {
  border-bottom: 0;
}

.app-user__group a {
  display: block;
  padding: 6px 8px;
  border-radius: 5px;
  color: var(--ui-text);
  font-size: 0.72rem;
  text-decoration: none;
}

.app-user__group a:hover {
  background: var(--ui-accent-soft);
  color: var(--ui-accent-bright);
}

.app-user__logout {
  margin: 4px 0 0;
  padding-top: 5px;
  border-top: 1px solid var(--ui-border-soft);
}

.app-user__logout button {
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ui-red);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.app-user__logout button:hover {
  background: rgba(251, 113, 133, 0.1);
}



/* --------------------------------------------------------------------------
   3. Tab strip
   -------------------------------------------------------------------------- */

.app-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  min-width: 0;
  padding: 0 6px;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--ui-bg-soft);
  border-bottom: 1px solid var(--ui-border);
  scrollbar-width: none;
}

.app-tabs:empty {
  display: none;
}

.app-tabs::-webkit-scrollbar {
  display: none;
}

.app-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
  max-width: 220px;
  min-width: 110px;
  padding: 0;
  border-right: 1px solid var(--ui-border-soft);
  border-left: 1px solid transparent;
  color: var(--ui-text-muted);
  font-size: 0.68rem;
  font-weight: 550;
  text-decoration: none;
  background: transparent;
}

.app-tab__link {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 4px 0 10px;
  color: inherit;
  text-decoration: none;
}

.app-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ui-text);
}

.app-tab--active {
  background: var(--ui-bg);
  color: var(--ui-text-strong);
  border-left-color: var(--ui-border);
}

.app-tab--active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ui-accent);
}

.app-tab__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ui-text-faint);
  flex: 0 0 auto;
}

.app-tab--active .app-tab__dot {
  background: var(--ui-accent);
  box-shadow: 0 0 7px rgba(249, 115, 22, 0.7);
}

.app-tab__label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tab__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 5px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ui-text-faint);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
}

.app-tab:hover .app-tab__close,
.app-tab--active .app-tab__close {
  opacity: 1;
}

.app-tab__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--ui-text-strong);
}

.app-tab--home {
  min-width: 0;
}

/* --------------------------------------------------------------------------
   4. Status bar
   -------------------------------------------------------------------------- */

.app-statusbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 26px;
  padding: 0 10px;
  background: var(--ui-chrome-solid);
  border-top: 1px solid var(--ui-border);
  color: var(--ui-text-faint);
  font-size: 0.62rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
}

.app-statusbar__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-statusbar__item--online {
  color: var(--ui-green);
  font-weight: 600;
}

.app-statusbar__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ui-green);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.8);
}

.app-statusbar__sep {
  width: 1px;
  height: 11px;
  background: var(--ui-border);
  flex: 0 0 auto;
}

.app-statusbar__spacer {
  flex: 1 1 auto;
}

.app-statusbar__brand {
  color: var(--ui-text-muted);
  font-weight: 600;
}



/* --------------------------------------------------------------------------
   5. Navigation panel
   -------------------------------------------------------------------------- */

body.app-shell .sidebar {
  position: relative;
  top: auto;
  align-self: stretch;
  flex: 0 0 252px;
  width: 252px;
  height: 100%;
  margin: 0;
  padding: 10px 8px 8px;
  border: 0;
  border-right: 1px solid var(--ui-border);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 30%),
    var(--ui-bg-soft);
  box-shadow: none;
  overflow: hidden;
}

body.app-shell .sidebar::before {
  display: none;
}

body.app-shell .sidebar__identity {
  padding: 4px 7px 8px;
  gap: 0.1rem 0.55rem;
}

body.app-shell .sidebar__identity::after {
  margin-top: 0.4rem;
}

body.app-shell .sidebar__group {
  font-size: 0.78rem;
  font-weight: 650;
}

body.app-shell .sidebar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 0.82rem;
}

body.app-shell .sidebar__user {
  font-size: 0.68rem;
}

body.app-shell .sidebar__title {
  margin-top: 0.08rem;
  font-size: 0.58rem;
}

body.app-shell .sidebar__manage {
  margin-top: 0.35rem;
  padding: 0.22rem 0.5rem;
  font-size: 0.62rem;
}

body.app-shell .sidebar__heading {
  margin: 0.15rem 0 0.35rem;
  padding: 0 0.5rem 0.4rem;
  font-size: 0.55rem;
  letter-spacing: 0.14em;
}

body.app-shell .sidebar__nav {
  gap: 0.06rem;
}

body.app-shell .sidebar__link {
  padding: 0.38rem 0.55rem;
  border-radius: 6px;
  font-size: 0.78rem;
}

body.app-shell .sidebar__sublink {
  padding: 0.27rem 0.5rem;
  border-radius: 5px;
  font-size: 0.72rem;
}

body.app-shell .sidebar__submenu {
  margin: 0.06rem 0 0.22rem;
  padding-left: 0.45rem;
}

body.app-shell .sidebar__head--group {
  padding: 0.28rem 0.45rem;
}

body.app-shell .sidebar__label {
  font-size: 0.56rem;
  letter-spacing: 0.12em;
}

body.app-shell .sidebar__link--active::before {
  left: 0.05rem;
  height: 0.9rem;
}

/* --------------------------------------------------------------------------
   6. Work area density
   -------------------------------------------------------------------------- */

body.app-shell .content > .messages {
  max-width: 1600px;
  margin-inline: auto;
}

body.app-shell .page-header {
  margin: 0 auto 14px;
  padding: 0 0 10px;
  max-width: 1600px;
  border-bottom: 1px solid var(--ui-border);
}

body.app-shell .page-header::after {
  display: none;
}

body.app-shell .page-title {
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

body.app-shell .page-lead {
  margin-top: 4px;
  max-width: 92ch;
  font-size: 0.79rem;
  line-height: 1.45;
}

body.app-shell .eyebrow {
  margin-bottom: 3px;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
}

body.app-shell .section-title {
  margin: 16px 0 8px;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

body.app-shell .ozet-satiri,
body.app-shell .cards,
body.app-shell .cards--sik,
body.app-shell .tablo,
body.app-shell .bolum,
body.app-shell .liste-gruplari,
body.app-shell .arac-cubugu,
body.app-shell .eylemler {
  max-width: 1600px;
  margin-inline: auto;
}

body.app-shell .ozet-satiri {
  gap: 8px;
  margin-bottom: 12px;
}

body.app-shell .ozet-kutu {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--ui-border);
  background: var(--ui-surface-solid);
  box-shadow: none;
}

body.app-shell .ozet-kutu__deger {
  font-size: 1.25rem;
}

body.app-shell .ozet-kutu__etiket {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
}

body.app-shell .cards {
  gap: 10px;
}

body.app-shell .card {
  border-radius: 9px;
  box-shadow: none;
  background: var(--ui-surface-solid);
}

body.app-shell .card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--ui-border-strong);
}

body.app-shell .card--modul {
  padding: 14px;
}

body.app-shell .card__title {
  font-size: 0.9rem;
}

body.app-shell .card__meta,
body.app-shell .card__metin {
  font-size: 0.72rem;
}

body.app-shell .bolum {
  margin-bottom: 12px;
  padding: 13px 14px;
  border-radius: 9px;
  box-shadow: none;
  background: var(--ui-surface-solid);
}

body.app-shell .summary__row {
  padding: 4px 0;
}

body.app-shell .summary dt,
body.app-shell .summary dd {
  font-size: 0.76rem;
}

body.app-shell .tablo {
  font-size: 0.76rem;
}

body.app-shell .tablo th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 8px;
  background: var(--ui-surface-2);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
}

body.app-shell .tablo td {
  padding: 6px 8px;
}

body.app-shell .tablo tbody tr:hover {
  background: rgba(249, 115, 22, 0.045);
}

body.app-shell .liste-grubu {
  border-radius: 9px;
  box-shadow: none;
  background: var(--ui-surface-solid);
}

body.app-shell .liste-grubu__baslik {
  padding: 7px 10px;
}

body.app-shell .arac-cubugu,
body.app-shell .eylemler {
  gap: 6px;
  margin-bottom: 10px;
}

body.app-shell .button-primary,
body.app-shell .button-secondary,
body.app-shell .button--ghost {
  height: 29px;
  padding: 0 0.7rem;
  border-radius: 6px;
  font-size: 0.74rem;
}

body.app-shell .arama {
  gap: 6px;
}

body.app-shell .arama input,
body.app-shell .arama select {
  height: 29px;
  font-size: 0.74rem;
}

body.app-shell .field label,
body.app-shell .field__etiket {
  font-size: 0.7rem;
}

body.app-shell input:not([type="checkbox"]):not([type="radio"]),
body.app-shell select,
body.app-shell textarea {
  font-size: 0.78rem;
}

body.app-shell .field__yardim {
  font-size: 0.64rem;
}



/* --------------------------------------------------------------------------
   7. Command palette
   -------------------------------------------------------------------------- */

.command {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 16px 16px;
  background: rgba(2, 5, 12, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.command[hidden] {
  display: none;
}

.command__box {
  width: min(620px, 94vw);
  max-height: 68vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ui-border-strong);
  border-radius: 12px;
  background: var(--ui-surface-solid);
  box-shadow: var(--ui-shadow-3);
  overflow: hidden;
}

.command__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ui-border);
}

.command__head svg {
  width: 17px;
  height: 17px;
  color: var(--ui-text-muted);
  flex: 0 0 auto;
}

.command__head input {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ui-text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

.command__head input::placeholder {
  color: var(--ui-text-faint);
}

.command__list {
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-y: auto;
  min-height: 0;
}

.command__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-text);
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}

.command__item:hover,
.command__item--active {
  background: var(--ui-accent-soft);
  color: var(--ui-accent-bright);
}

.command__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--ui-border);
  border-radius: 5px;
  background: var(--ui-surface-2);
  color: var(--ui-text-muted);
  font-size: 0.66rem;
  font-weight: 750;
  flex: 0 0 auto;
}

.command__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command__hint {
  font-size: 0.62rem;
  color: var(--ui-text-faint);
  flex: 0 0 auto;
}

.command__empty {
  padding: 18px 12px;
  color: var(--ui-text-muted);
  font-size: 0.76rem;
  text-align: center;
}

.command__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-top: 1px solid var(--ui-border);
  color: var(--ui-text-faint);
  font-size: 0.62rem;
}

.command__foot kbd {
  display: inline-flex;
  padding: 1px 4px;
  border: 1px solid var(--ui-border);
  border-radius: 3px;
  font-family: var(--ui-mono);
  font-size: 0.58rem;
}



/* --------------------------------------------------------------------------
   8. Chrome colours (dark in both themes)
   -------------------------------------------------------------------------- */

body.app-shell .appbar {
  color: #e8eefb;
}

body.app-shell .appbar__brand-text strong,
body.app-shell .appbar__workspace,
body.app-shell .app-user__name {
  color: #eef4ff;
}

body.app-shell .appbar__brand-text small,
body.app-shell .appbar__search,
body.app-shell .app-user__meta {
  color: #93a5c6;
}

body.app-shell .appbar__icon,
body.app-shell .app-user__caret {
  color: #9db1cf;
}

body.app-shell .appbar__icon:hover,
body.app-shell .appbar__icon:focus-visible {
  color: #fff;
}

body.app-shell .app-user__trigger:hover,
body.app-shell .app-user[open] .app-user__trigger {
  background: rgba(255, 255, 255, 0.07);
}

body.app-shell .app-statusbar {
  color: #7f93b3;
}

body.app-shell .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 32%),
    #081020;
}

/* The account menu and palette are surfaces, not chrome, so they follow the
   theme; only their trigger lives on the dark title bar. */
body.app-shell .app-user__menu,
body.app-shell .command__box {
  color: var(--ui-text);
}



/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 1025px) {
  body.app-shell.sidebar-collapsed .sidebar {
    display: none;
  }
}

@media (max-width: 1180px) {
  .app-user__text,
  .app-user__caret {
    display: none;
  }

  .app-user__trigger {
    padding: 3px;
  }

  .appbar__search {
    flex-basis: 360px;
  }

  .appbar__workspace {
    max-width: 150px;
  }
}

@media (max-width: 1024px) {
  body.app-shell .layout {
    display: block;
    padding: 0;
  }

  body.app-shell .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    display: flex;
    width: min(320px, 86vw);
    height: 100dvh;
    transform: translateX(-104%);
    transition: transform 0.28s var(--ui-ease);
    border-right: 1px solid var(--ui-border);
    border-radius: 0 10px 10px 0;
    box-shadow: 30px 0 80px -40px rgba(0, 0, 0, 0.9);
  }

  body.app-shell.nav-open .sidebar {
    transform: translateX(0);
  }

  body.app-shell .sidebar__close {
    display: inline-flex;
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 2;
  }

  body.app-shell .nav-backdrop {
    inset: 0;
    z-index: 85;
  }

  body.app-shell .content {
    padding: 14px 14px 30px;
  }
}

@media (max-width: 940px) {
  .appbar__workspace,
  .appbar__divider {
    display: none;
  }

  .appbar__search {
    flex-basis: auto;
    min-width: 0;
    flex: 1 1 auto;
  }

  .appbar__kbd {
    display: none;
  }

  .appbar__brand {
    padding-right: 4px;
  }
}

@media (max-width: 700px) {
  body.app-shell {
    grid-template-rows: 46px 32px minmax(0, 1fr) 24px;
  }

  .appbar {
    height: 46px;
  }

  .appbar__search-label {
    display: none;
  }

  .appbar__search {
    flex: 0 0 auto;
    width: 30px;
    padding: 0;
    justify-content: center;
  }

  .appbar__search svg {
    width: 15px;
    height: 15px;
  }

  .appbar__brand-text small {
    display: none;
  }

  .app-statusbar__item:nth-of-type(n + 4) {
    display: none;
  }

  body.app-shell .page-title {
    font-size: 1.12rem;
  }

  body.app-shell .page-lead {
    font-size: 0.75rem;
  }

  body.app-shell .content {
    padding: 11px 10px 24px;
  }
}

@media (max-width: 480px) {
  .app-user__trigger {
    display: none;
  }

  .appbar__brand-text strong {
    font-size: 0.72rem;
  }

  .app-tab {
    min-width: 92px;
  }
}

/* --------------------------------------------------------------------------
   10. Print — the document, not the application
   -------------------------------------------------------------------------- */

@media print {
  body.app-shell {
    display: block;
    height: auto;
    overflow: visible;
  }

  body.app-shell .appbar,
  body.app-shell .app-tabs,
  body.app-shell .app-statusbar,
  body.app-shell .sidebar,
  body.app-shell .nav-backdrop {
    display: none !important;
  }

  body.app-shell .layout {
    display: block;
    overflow: visible;
  }

  body.app-shell .content {
    overflow: visible;
    height: auto;
    padding: 0;
    background: #fff;
  }
}



/* --------------------------------------------------------------------------
   11. Workspace home
   -------------------------------------------------------------------------- */

.app-home {
  max-width: 1600px;
  margin-inline: auto;
}

.app-home__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.app-launch {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  background: var(--ui-surface-solid);
  color: var(--ui-text);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.app-launch:hover {
  border-color: var(--ui-accent-line);
  background: var(--ui-surface-2);
}

.app-launch__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ui-accent-line);
  border-radius: 8px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent-bright);
  font-size: 1rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.app-launch__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.app-launch__body strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--ui-text-strong);
}

.app-launch__body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.66rem;
  color: var(--ui-text-muted);
}

.app-launch__cta {
  margin-left: auto;
  color: var(--ui-text-faint);
  font-size: 0.9rem;
  transition: color 0.15s ease, transform 0.15s ease;
}

.app-launch:hover .app-launch__cta {
  color: var(--ui-accent-bright);
  transform: translateX(2px);
}

.app-home__shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 8px;
}

.app-shortcut {
  padding: 10px 12px;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  background: var(--ui-surface-solid);
}

.app-shortcut__title {
  display: block;
  margin-bottom: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ui-text-faint);
}

.app-shortcut__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.app-shortcut__links a {
  padding: 3px 7px;
  border: 1px solid var(--ui-border);
  border-radius: 5px;
  background: var(--ui-surface-2);
  color: var(--ui-text);
  font-size: 0.68rem;
  text-decoration: none;
}

.app-shortcut__links a:hover {
  border-color: var(--ui-accent-line);
  background: var(--ui-accent-soft);
  color: var(--ui-accent-bright);
}

/* Menu content must never leak into the title bar. */
.app-user:not([open]) .app-user__menu {
  display: none;
}

