.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(31, 36, 48, 0.15);
  background: var(--panel);
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 999px;
}

textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(31, 36, 48, 0.15);
  font-family: var(--font-body);
  resize: vertical;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.status-published {
  background: rgba(27, 153, 139, 0.15);
  color: #1b998b;
  border-color: rgba(27, 153, 139, 0.4);
}

.status-draft {
  background: rgba(100, 116, 139, 0.16);
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.4);
}

.status-archived {
  background: rgba(232, 107, 44, 0.16);
  color: #e86b2c;
  border-color: rgba(232, 107, 44, 0.4);
}

.card-list--blog {
  display: none;
}

.card-list__empty {
  padding: var(--space-3);
  border: 1px dashed rgba(31, 36, 48, 0.2);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.blog-card {
  background: var(--panel-strong);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
  display: grid;
  gap: var(--space-3);
}

.blog-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.blog-card__info {
  display: grid;
  gap: 4px;
}

.blog-card__meta {
  color: var(--muted);
  font-size: 13px;
  word-break: break-word;
}

.blog-card__body {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(31, 36, 48, 0.08);
  padding-top: var(--space-2);
}

.blog-card__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--muted);
  font-size: 13px;
}

.blog-card__row span:last-child {
  color: var(--ink);
  font-weight: 600;
  word-break: break-word;
  text-align: right;
}

.blog-card__actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.module-pagination {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(31, 36, 48, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.module-pagination__left,
.module-pagination__right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.module-pagination__left label,
.module-pagination__summary,
.module-pagination__info {
  font-size: 12px;
  color: var(--muted);
}

.module-pagination select {
  min-width: 86px;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(31, 36, 48, 0.2);
  color: var(--ink);
  background: var(--panel);
}

.sidenav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 960px) {
  .nav-toggle {
    display: flex; /* IMPORTANT: when visible */
    flex-direction: column; /* ✅ makes 3 lines vertical */
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    width: 260px;
    max-width: 82%;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 30;
    overflow-y: auto;
  }

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

  .sidenav-backdrop {
    display: block;
  }

  .app-shell.is-nav-open .sidenav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .main {
    width: 100%;
    min-width: 0;
  }

  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .topbar h1 {
    font-size: 26px;
  }

  .card__row {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
  }

  .topbar__actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar__actions > * {
    width: 100%;
    justify-content: center;
  }

  .actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .actions > * {
    width: 100%;
  }

  .actions input,
  .actions select,
  .actions button {
    width: 100%;
    max-width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .table-wrap--blog {
    display: none;
  }

  .card-list--blog {
    display: grid;
    gap: var(--space-3);
  }

  .module-pagination {
    align-items: stretch;
  }

  .module-pagination__left,
  .module-pagination__right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  .sidebar {
    width: 280px;
    max-width: calc(100% - 16px);
    padding: var(--space-3);
  }

  .main {
    padding: var(--space-3);
  }

  .card {
    padding: var(--space-4);
  }

  .brand__mark {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  .topbar__actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .topbar__actions > * {
    width: 100%;
    justify-content: center;
  }

  .sidebar__footer {
    display: none;
  }
}

@media (max-width: 420px) {
  .topbar h1 {
    font-size: 22px;
  }

  .card {
    padding: var(--space-3);
  }

  .brand__text {
    display: none;
  }

  .btn {
    padding: 9px 14px;
  }

  .pill {
    font-size: 11px;
    padding: 4px 10px;
  }

  .nav-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .nav-toggle span {
    width: 16px;
  }

  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  .blog-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .blog-card__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .blog-card__row {
    flex-direction: column;
    align-items: flex-start;
  }

  .blog-card__row span:last-child {
    text-align: left;
  }
}
