.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card,
.empty-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card,
.empty-card {
  padding: 18px;
}

.stat-card__label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 700;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.stat-card__value--sm {
  font-size: 18px;
  line-height: 1.35;
  word-break: break-word;
}

.empty-card {
  color: var(--muted);
  background: var(--panel-soft);
}

.panel {
  overflow: hidden;
}

.panel--sidebar,
.panel--main {
  min-height: 520px;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.panel__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.panel__body {
  padding: 18px;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.auth-brand {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-title {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.2;
}

.auth-subtitle {
  margin: 0 0 22px;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.alert {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.auth-demo {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.auth-demo-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
}

.auth-demo-item,
.auth-demo-note {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.hero-card {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
}

.hero-card__title {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
}

.hero-card__subtitle {
  margin: 0;
  max-width: 780px;
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.95;
}

.section-block {
  margin-top: 22px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.section-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.dashboard-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-stats {
  display: grid;
  gap: 12px;
}

.mini-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.mini-stat__label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.list-stack {
  display: grid;
  gap: 12px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.list-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.list-row__title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.list-row__meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.list-row__time {
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.tree-list {
  display: grid;
  gap: 10px;
}

.tree-group {
  display: grid;
  gap: 8px;
}

.tree-children {
  margin-left: 14px;
  display: grid;
  gap: 8px;
}

.tree-node {
  display: block;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
}

.tree-node:hover {
  background: var(--panel-soft);
}

.tree-node--category {
  background: #eff6ff;
  color: #1d4ed8;
}

.tree-node--subject {
  background: #f8fafc;
}

.tree-node--module {
  background: #ffffff;
}

.tree-node--chapter {
  background: #fcfcfd;
}

.tree-node--section {
  background: #f9fafb;
  font-weight: 600;
}

.panel__head--stack {
  align-items: flex-start;
  flex-direction: row;
}

.detail-path {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.detail-card {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.detail-card__title {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
}

.detail-card__text {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.detail-card__content {
  margin-top: 12px;
}

.prose-box {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.meta-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.section-subpanel {
  margin-top: 18px;
}

.inline-link {
  color: var(--primary);
  text-decoration: none;
}

.inline-link:hover {
  text-decoration: underline;
}

.detail-summary-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-soft);
}

.question-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.question-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.question-card__title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 6px;
}

.question-card__meta {
  color: var(--muted);
  font-size: 12px;
}

.comment-form {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.comment-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.comment-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.comment-card__head span {
  color: var(--muted);
}

.comment-card__body {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.comment-card__meta {
  color: var(--muted);
  font-size: 12px;
}

.studio-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.studio-toolbar__title {
  font-size: 16px;
  font-weight: 800;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.tab-link.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.studio-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.studio-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.studio-table thead th {
  text-align: left;
  padding: 14px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.studio-table tbody td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
}

.studio-table tbody tr:last-child td {
  border-bottom: 0;     
}

.table-main {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
}

.table-sub {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.tag-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11px;
  font-weight: 700;
}

.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-danger-soft {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.app-modal.hidden {
  display: none;
}

.app-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.app-modal__dialog {
  position: relative;
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.app-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.app-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.app-modal__close {
  border: 0;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.app-modal__body {
  padding: 18px;
  overflow: auto;
  max-height: calc(100vh - 160px);
}

.app-modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-group--full {
  grid-column: 1 / -1;
}
.workspace-tree__children {
  display: none;
  padding-left: 14px;
}

.workspace-tree__item.is-open > .workspace-tree__children {
  display: block;
}

.workspace-tree__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.workspace-tree__row.is-active .workspace-tree__link {
  font-weight: 700;
}

.workspace-tree__toggle {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}

.workspace-tree__item.is-open > .workspace-tree__row > .workspace-tree__toggle {
  transform: rotate(90deg);
}

.workspace-tree__toggle--empty {
  visibility: hidden;
  pointer-events: none;
}

.workspace-tree__link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  padding: 4px 0;
}

.workspace-tab-panel {
  display: none;
}

.workspace-tab-panel.is-active {
  display: block;
}
.workspace-tree__children {
  display: none;
  padding-left: 14px;
}

.workspace-tree__item.is-open > .workspace-tree__children {
  display: block;
}

.workspace-tree__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.workspace-tree__toggle {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.workspace-tree__item.is-open > .workspace-tree__row > .workspace-tree__toggle {
  transform: rotate(90deg);
}

.workspace-tree__toggle--empty {
  visibility: hidden;
  pointer-events: none;
}

.workspace-tree__link {
  text-decoration: none;
  color: inherit;
}
  
 .workspace-tree__toggle {
  width: 22px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}

.workspace-tree__toggle--empty {
  visibility: hidden;
  pointer-events: none;
}

.workspace-tree__children {
  display: none;
  padding-left: 16px;
}

.workspace-tree__item.is-open > .workspace-tree__children {
  display: block;
}

.workspace-tree__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.workspace-type-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.workspace-tab-panel {
  display: none;
}

.workspace-tab-panel.is-active {
  display: block;
}
.workspace-inline-comments {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.workspace-inline-comments__head {
    margin-bottom: 12px;
}

.workspace-inline-comments__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.workspace-inline-comment-form {
    margin-bottom: 14px;
}

.workspace-inline-comment-box {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 12px;
}

.workspace-inline-comment-textarea {
    min-height: 82px;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    resize: vertical;
}

.workspace-inline-comment-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.workspace-inline-comment-message {
    margin: 10px 0 0;
    font-size: 13px;
}

.workspace-comment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

.workspace-comment {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.workspace-comment__avatar,
.workspace-reply__avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex: 0 0 36px;
}

.workspace-comment__main {
    flex: 1 1 auto;
    min-width: 0;
}

.workspace-comment__bubble {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    padding: 10px 12px;
}

.workspace-comment__meta,
.workspace-reply__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.workspace-comment__text,
.workspace-reply__text {
    font-size: 14px;
    line-height: 1.55;
    color: #0f172a;
}

.workspace-comment__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px 0;
}

.workspace-comment__action {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.workspace-comment__count {
    font-size: 12px;
    color: #64748b;
    min-width: 10px;
}

.workspace-replies {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    margin-left: 18px;
}

.workspace-reply {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.workspace-reply__body {
    flex: 1 1 auto;
    min-width: 0;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 9px 11px;
}

.workspace-reply-form {
    margin-top: 10px;
    margin-left: 18px;
}

.workspace-reply-form textarea {
    width: 100%;
    min-height: 72px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 10px 12px;
    resize: vertical;
}

.workspace-reply-form__actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.hidden {
    display: none !important;
}
.hidden {
    display: none !important;
}

.workspace-head-flex{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:20px;
    width:100%;
    flex-wrap:nowrap;
}

.workspace-head-flex__left{
    flex:1 1 auto;
    min-width:260px;
}

.workspace-head-flex__left .page-title{
    margin:0 0 8px 0;
    line-height:1.1;
}

.workspace-head-flex__left .page-subtitle{
    margin:0;
    max-width:760px;
    line-height:1.45;
    white-space:normal;
    word-break:normal;
}

.workspace-top-filters-right{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:12px;
    flex:0 0 auto;
    margin-left:auto;
    min-width:max-content;
}

.workspace-select-wrap{
    position:relative;
    min-width:180px;
}

.workspace-top-select{
    width:180px;
    height:42px;
    padding:0 38px 0 16px;
    border:none;
    border-radius:999px;
    background:#e91e63;
    color:#ffffff;
    font-size:14px;
    font-weight:700;
    line-height:42px;
    cursor:pointer;
    outline:none;
    appearance:none;
    -webkit-appearance:none;
    -moz-appearance:none;
    box-shadow:none;
}

.workspace-top-select::-ms-expand{
    display:none;
}

.workspace-select-wrap::after{
    content:"▼";
    position:absolute;
    right:14px;
    top:50%;
    transform:translateY(-50%);
    color:#ffffff;
    font-size:10px;
    font-weight:700;
    pointer-events:none;
}

.workspace-top-select option{
    color:#111827;
    background:#ffffff;
}

@media (max-width:1100px){
    .workspace-head-flex{
        flex-wrap:wrap;
        align-items:flex-start;
    }

    .workspace-top-filters-right{
        width:100%;
        justify-content:flex-start;
        margin-left:0;
    }
}

@media (max-width:640px){
    .workspace-top-filters-right{
        flex-direction:column;
        align-items:stretch;
    }

    .workspace-select-wrap,
    .workspace-top-select{
        width:100%;
        min-width:100%;
    }
}

/* ===== Workspace Page Enhancement ===== */

.workspace-page {
    padding-top: 26px;
}

.workspace-layout {
    align-items: start;
}

.workspace-sidebar,
.workspace-main {
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.workspace-sidebar .panel__head,
.workspace-main .panel__head {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.workspace-tree {
    display: grid;
    gap: 6px;
}

.workspace-tree__row {
    min-height: 38px;
    padding: 7px 10px;
    border-radius: 12px;
    transition: 0.18s ease;
}

.workspace-tree__row:hover {
    background: #f8fafc;
}

.workspace-tree__link {
    font-size: 14px;
    line-height: 1.25;
    color: #0f172a;
}

.workspace-tree__item--module > .workspace-tree__row {
    font-weight: 800;
}

.workspace-tree__item--chapter > .workspace-tree__row {
    margin-left: 8px;
}

.workspace-tree__item--section > .workspace-tree__row {
    margin-left: 16px;
    background: #f9fafb;
}

.workspace-tree__item--section .workspace-tree__link {
    font-size: 13px;
    color: #334155;
}

.workspace-tree__toggle {
    color: #334155;
    border-radius: 8px;
}

.workspace-tree__toggle:hover {
    background: #e2e8f0;
}

.workspace-type-chip {
    min-width: 38px;
    height: 24px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 11px;
    font-weight: 800;
}

.workspace-tree__item--section .workspace-type-chip {
    background: #ecfeff;
    color: #0e7490;
}

.workspace-detail-topbar {
    gap: 16px;
}

.workspace-current-section-pill {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
}

.detail-card {
    border-radius: 18px;
    padding: 22px;
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.detail-card__title {
    font-size: 26px;
    letter-spacing: -0.03em;
}

.prose-box {
    padding: 18px;
    border-radius: 16px;
    background: #f8fafc;
    font-size: 15px;
    line-height: 1.8;
}

.meta-pill,
.chip {
    font-weight: 800;
}

.workspace-inline-comment-box {
    border-radius: 16px;
    background: #f8fafc;
}

.workspace-top-select {
    height: 44px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e91e63, #ec1763);
    box-shadow: 0 8px 18px rgba(233, 30, 99, 0.18);
}

.workspace-top-select:hover {
    filter: brightness(1.03);
}

@media (max-width: 900px) {
    .workspace-layout {
        grid-template-columns: 1fr;
    }

    .workspace-sidebar,
    .workspace-main {
        min-height: auto;
    }
}

.workspace-tree__children {
    display: block !important;
}

.workspace-section-nav {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.workspace-section-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.workspace-detail-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.workspace-detail-topbar__left {
    min-width: 0;
}

.workspace-detail-topbar__right {
    justify-self: end;
    margin-left: 0;
}

.workspace-section-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    margin-top: 12px;
}

.workspace-section-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.workspace-section-nav-btn--prev {
    background: #f1f5f9;
    color: #334155;
    margin-top: 10px;
}

.workspace-section-nav-btn--next {
    background: #2563eb;
    color: #fff;
}

.workspace-section-nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

/* COMMENTS (unchanged + clean) */
.workspace-inline-comments__head {
  width: 100%;
  border: 0;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.workspace-inline-comments__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.workspace-inline-comments__title span {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-comments-toggle-text {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.workspace-inline-comments.is-collapsed .workspace-inline-comments__body {
  display: none;
}

/* FIX workspace huge blank top gap */
.workspace-page {
    padding-top: 26px !important;
    margin-top: 0 !important;
}

.app-main {
    padding-top: 0 !important;
}

.page-wrap.workspace-page {
    min-height: auto !important;
}

.workspace-head-flex {
    margin-top: 0 !important;
}

.workspace-layout {
    margin-top: 18px !important;
}

/* fix accidental oversized empty block/header */
.workspace-page::before,
.workspace-page::after,
.app-main::before,
.app-main::after {
    display: none !important;
    content: none !important;
}

/* keep content normal */
.panel--sidebar,
.panel--main {
    min-height: 520px;
}
.app-nav-link--active {
    background: rgba(37, 99, 235, 0.16);
    color: #ffffff;
    font-weight: 800;
}

.app-nav-link--active::before {
    content: "";
    width: 4px;
    height: 22px;
    background: #2563eb;
    border-radius: 999px;
    position: absolute;
    left: 0;
}

.app-nav-link {
    position: relative;
}

.app-nav-link--danger.app-nav-link--active {
    background: rgba(225, 29, 72, 0.22);
}
.app-sidebar .app-nav-link {
    position: relative;
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    background: transparent;
    font-weight: 700;
}

.app-sidebar .app-nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
}

.app-sidebar .app-nav-link--active {
    background: #2563eb !important;
    color: #ffffff !important;
}

.app-sidebar .app-nav-link--active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    border-radius: 999px;
    background: #ffffff;
}

.app-sidebar .app-nav-link--danger {
    background: transparent !important;
    color: #ffffff;
}

.app-sidebar .app-nav-link--danger:hover {
    background: rgba(225, 29, 72, 0.22) !important;
    color: #ffffff;
}