/* Shared application frame. Page styles and business forms remain in app.css. */
.workspace-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
}

.workspace-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  max-width: 1760px;
  margin: 0 auto;
  padding: 12px 28px;
}

.workspace-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--app-text);
  text-decoration: none;
}

.workspace-brand:hover { color: var(--app-text); }
.workspace-brand img {
  display: block;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.workspace-brand > span { min-width: 0; }
.workspace-brand strong,
.workspace-brand small { display: block; }
.workspace-brand strong { font-size: .95rem; line-height: 1.3; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-brand small { margin-top: 3px; color: var(--app-muted); font-size: .74rem; line-height: 1.3; }

.workspace-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.workspace-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 300px;
  color: var(--app-muted);
  font-size: .78rem;
  font-weight: 600;
}
.workspace-account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-account-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 1.1rem;
}
svg.workspace-account-icon { display: block; width: 28px; height: 20px; }
.workspace-account-icon-nextcloud { color: #0082c9; }
[data-theme="dark"] .workspace-account-icon-nextcloud { color: #75c4f2; }

.workspace-icon-button,
.workspace-menu-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  color: var(--app-muted);
  font-size: 1rem;
  text-decoration: none;
}
.workspace-icon-button:hover,
.workspace-menu-toggle:hover {
  border-color: var(--app-muted);
  background: var(--app-surface-soft);
  color: var(--app-text);
}
.workspace-header .theme-switcher {
  border-color: var(--app-border);
  background: var(--app-surface-soft);
  box-shadow: none;
}
.workspace-header .theme-choice:not([aria-pressed="true"]) { color: var(--app-muted); }
.workspace-header .theme-choice:not([aria-pressed="true"]):hover { color: var(--app-text); }

.workspace-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 24px 28px 40px;
}
.workspace-main { min-width: 0; width: 100%; }
.workspace-location {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--app-muted);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.5;
}

.workspace-sidebar {
  --bs-offcanvas-width: 292px;
  --bs-offcanvas-bg: #173849;
  --bs-offcanvas-color: #d3e1e9;
  --bs-offcanvas-border-color: transparent;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background-color: #173849 !important;
  color: #d3e1e9;
  box-shadow: 0 8px 24px rgba(23, 55, 79, .08);
  color-scheme: dark;
}
[data-theme="dark"] .workspace-sidebar { background-color: #142f3e !important; }

.workspace-sidebar-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 22px 20px 16px;
}
.workspace-sidebar-heading small,
.workspace-sidebar-heading .eyebrow,
.workspace-sidebar-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #a7c1d0;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.5;
  text-transform: uppercase;
}
.workspace-sidebar-heading h2 {
  margin: 0;
  color: #f0f7fa;
  font-size: .87rem;
  font-weight: 700;
  line-height: 1.5;
}
.workspace-sidebar-heading .btn-close { flex: 0 0 auto; opacity: .75; }

.workspace-sidebar-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 12px 12px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #688396 transparent;
}
.workspace-sidebar-scroll::-webkit-scrollbar { width: 5px; }
.workspace-sidebar-scroll::-webkit-scrollbar-thumb { border-radius: 8px; background: #688396; }
.workspace-nav-group + .workspace-nav-group {
  margin-top: 9px;
  border-top: 1px solid rgba(190, 214, 228, .14);
}
.workspace-nav-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 37px;
  padding: 11px 10px 8px;
  color: #a7c1d0;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.5;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
  border-radius: 6px;
}
.workspace-nav-label::-webkit-details-marker { display: none; }
.workspace-nav-label::marker { content: ""; }
.workspace-nav-label:hover { color: #eff8fc; }
.workspace-nav-label > .bi { flex: 0 0 auto; font-size: .65rem; transform: rotate(-90deg); }
.workspace-nav-group[open] > .workspace-nav-label > .bi { transform: rotate(0); }
.workspace-nav-items { display: grid; gap: 2px; }
.workspace-nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #d3e1e9;
  font-size: .8rem;
  font-weight: 550;
  line-height: 1.4;
  text-decoration: none;
}
.workspace-nav-link > .bi {
  display: inline-flex;
  flex: 0 0 17px;
  align-items: center;
  justify-content: center;
  width: 17px;
  color: #a7c1d0;
  font-size: .94rem;
}
.workspace-nav-link > span { min-width: 0; overflow-wrap: break-word; }
.workspace-nav-link:hover { color: #fff; background: rgba(226, 242, 249, .08); }
.workspace-nav-link:hover > .bi { color: #d8ecef; }
.workspace-nav-link.active,
.workspace-nav-link[aria-current="page"] {
  color: #204958;
  background: #e1f3ee;
  box-shadow: inset 3px 0 0 #62bbae;
  font-weight: 700;
}
.workspace-nav-link.active > .bi,
.workspace-nav-link[aria-current="page"] > .bi { color: #28766f; }

.workspace-anonymous.workspace-shell,
.workspace-anonymous .workspace-shell {
  display: block;
  max-width: 1320px;
}
.workspace-skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 1100;
  padding: 10px 16px;
  border-radius: 8px;
  background: #e1f3ee;
  color: #173849;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}
.workspace-skip-link:focus { transform: translateY(0); }
.workspace-brand:focus-visible,
.workspace-icon-button:focus-visible,
.workspace-menu-toggle:focus-visible,
.workspace-header .theme-choice:focus-visible,
.workspace-nav-label:focus-visible,
.workspace-nav-link:focus-visible,
.workspace-skip-link:focus-visible {
  outline: 2px solid #63c3b5;
  outline-offset: 3px;
}

@media (min-width: 1200px) {
  .workspace-sidebar.offcanvas-xl {
    position: sticky;
    top: 100px;
    z-index: 1000;
    width: 244px !important;
    height: calc(100vh - 124px) !important;
    height: calc(100dvh - 124px) !important;
    max-height: 1060px;
    border-radius: 18px;
    background-color: #173849 !important;
  }
  [data-theme="dark"] .workspace-sidebar.offcanvas-xl { background-color: #142f3e !important; }
}

@media (max-width: 1199.98px) {
  .workspace-shell { display: block; padding: 24px 24px 36px; }
  .workspace-header-inner { gap: 12px; padding-right: 24px; padding-left: 24px; }
  .workspace-sidebar.offcanvas-xl {
    width: 292px;
    max-width: calc(100vw - 36px);
    height: 100vh;
    height: 100dvh;
    border-radius: 0 18px 18px 0;
  }
  .workspace-account { max-width: 200px; }
}

@media (max-width: 767.98px) {
  .workspace-header-inner { min-height: 68px; gap: 8px; padding: 10px 12px; }
  .workspace-brand { gap: 8px; flex: 1 1 auto; }
  .workspace-brand img { flex-basis: 34px; width: 34px; height: 34px; border-radius: 0; }
  .workspace-brand strong { font-size: .78rem; }
  .workspace-brand small { margin-top: 2px; font-size: .64rem; }
  .workspace-brand strong,
  .workspace-brand small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-header-actions { gap: 7px; }
  .workspace-account { display: none; }
  .workspace-icon-button,
  .workspace-menu-toggle { width: 34px; height: 34px; border-radius: 9px; font-size: .92rem; }
  .workspace-shell { padding: 18px 12px 28px; }
  .workspace-location { gap: 6px; margin-bottom: 14px; font-size: .68rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .workspace-header,
  .workspace-icon-button,
  .workspace-menu-toggle,
  .workspace-nav-link { transition: background-color .16s ease, color .16s ease, border-color .16s ease; }
  .workspace-nav-label > .bi { transition: transform .16s ease; }
}

@media print {
  .workspace-header,
  .workspace-sidebar,
  .workspace-location,
  .workspace-skip-link,
  .offcanvas-backdrop { display: none !important; }
  .workspace-shell { display: block !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .workspace-main { width: 100%; max-width: none; margin: 0; padding: 0; }
}

.workspace-account { text-decoration: none; }
.workspace-account:hover { color: var(--app-text); }
.workspace-main:focus { outline: none; }
.workspace-sidebar-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 34px; height: 34px; background: transparent; color: #d3e1e9; border: 1px solid rgba(190,214,228,.25); border-radius: 8px; }
.workspace-sidebar-close:focus-visible { outline: 2px solid #63c3b5; outline-offset: 3px; }

/* The original emblem is round; custom logos keep their full shape and alpha. */
.workspace-brand img.brand-default-logo, .login-logo.brand-default-logo { border-radius: 50%; }
.login-mark { border: 0; box-shadow: none; background: transparent; overflow: visible; }
.login-logo { object-fit: contain; }
