/* ==========================================================================
   Juguetipedia — Responsive Design System (Mobile-first + Desktop Enhanced)
   ========================================================================== */

:root {
  --bg: #ffffff;
  --surface: #f5f6f7;
  --surface-warm: #faf7f2;
  --border: #e6e8ec;
  --text: #182026;
  --text-muted: #66707a;
  --text-light: #8a949e;
  --primary: #2c7da0;
  --primary-hover: #226482;
  --primary-soft: #eaf4f8;
  --dark-slate: #162c35;
  --dark-btn: #3a3f44;
  --accent-new: #d95d4e;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(22, 44, 53, 0.05);
  --shadow-md: 0 8px 24px rgba(22, 44, 53, 0.08);
  --shadow-lg: 0 14px 36px rgba(22, 44, 53, 0.12);
  --header-mobile-h: 58px;
  --bottom-nav-h: 66px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  padding-bottom: calc(var(--bottom-nav-h) + 20px);
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px;
}

.desktop-only {
  display: none !important;
}

.mobile-only {
  display: block;
}

/* ==========================================================================
   HEADERS & NAVIGATION
   ========================================================================== */

.desktop-header {
  display: none;
}

.mobile-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-mobile-h);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(230, 232, 236, 0.7);
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  padding: 0 10px;
}

.mobile-header-title {
  text-align: center;
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-header-left,
.mobile-header-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background 0.18s ease;
}

.icon-btn:hover {
  background: var(--surface);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.notif-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-new);
  border: 1.5px solid #fff;
}

/* Mobile Bottom Tab Bar */
.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  height: var(--bottom-nav-h);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px env(safe-area-inset-bottom);
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  transition: color 0.16s ease;
}

.mobile-tab svg {
  width: 21px;
  height: 21px;
}

.mobile-tab.active {
  color: var(--text);
  font-weight: 700;
}

.mobile-tab.active svg {
  stroke-width: 2.4;
}

/* Notifications Drawer */
.notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 44, 53, 0.35);
  z-index: 90;
}

.notif-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  z-index: 100;
  padding: 16px;
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.notif-panel-header h3 {
  font-size: 1rem;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-list li {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s ease;
}

.notif-list li:hover {
  background: var(--primary-soft);
}

.notif-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-bottom: 4px;
}

.notif-list strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 3px;
}

.notif-list p {
  margin: 0 0 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.notif-list small {
  color: var(--text-light);
  font-size: 0.74rem;
}

/* ==========================================================================
   HOME VIEW (MOBILE-FIRST)
   ========================================================================== */

.hero-banner-wrap {
  display: none;
}

.search-strip-section {
  padding-top: 14px;
  padding-bottom: 6px;
}

.home-search-form {
  display: flex;
  align-items: center;
  background: #f2f3f5;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 4px 8px 4px 14px;
  gap: 10px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.home-search-form:focus-within {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 125, 160, 0.12);
}

.search-icon {
  color: var(--text-muted);
  display: inline-flex;
}

.search-icon svg {
  width: 19px;
  height: 19px;
}

.home-search-form input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
}

.home-search-form input::placeholder {
  color: var(--text-light);
}

.search-submit-btn {
  display: none;
}

/* Grade Filter Pills */
.grade-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}

.grade-filter-row::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-pill.active {
  background: var(--dark-slate);
  border-color: var(--dark-slate);
  color: #fff;
}

/* Home Sections */
.home-section {
  padding-top: 22px;
  padding-bottom: 8px;
}

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

.section-header h2 {
  font-size: 1.32rem;
  font-weight: 800;
}

.section-subtitle {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

/* Featured Horizontal Carousel on Mobile */
.featured-grid {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.featured-grid::-webkit-scrollbar {
  display: none;
}

.featured-card {
  flex: 0 0 74%;
  max-width: 280px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-warm);
  margin-bottom: 10px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.featured-card:hover .featured-thumb img {
  transform: scale(1.03);
}

.badge-new {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: var(--accent-new);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
}

.badge-format {
  position: absolute;
  right: 10px;
  top: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--dark-slate);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card-meta-top {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.featured-body h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

/* Category Chips */
.category-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: none;
}

.category-chip-row::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex: 0 0 auto;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-chip.active {
  background: var(--primary-soft);
  color: var(--primary);
}

/* Mobile New Resources: Matches Screenshot 1 (Left text, Right thumbnail) */
.resources-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.resource-card {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f2f4;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.resource-card:last-child {
  border-bottom: none;
}

.resource-thumb {
  flex: 0 0 116px;
  width: 116px;
  height: 86px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-warm);
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.resource-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-info {
  flex: 1;
  min-width: 0;
}

.resource-category {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.resource-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.28;
  margin-bottom: 4px;
  color: var(--text);
}

.resource-subtitle {
  margin: 0 0 6px;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 6px;
}

.meta-format {
  font-size: 0.74rem;
  color: var(--text-light);
}

/* ==========================================================================
   POST DETAIL VIEW (MOBILE-FIRST — Matches Screenshot 2)
   ========================================================================== */

.detail-container {
  padding-top: 0;
  padding-bottom: 24px;
}

.detail-hero-figure {
  margin: 0 -18px 18px;
  background: var(--surface-warm);
  overflow: hidden;
  max-height: 300px;
}

.detail-hero-figure img {
  width: 100%;
  height: 100%;
  max-height: 300px;
  object-fit: cover;
}

.detail-cat-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.mobile-detail-title h1 {
  font-size: 1.48rem;
  line-height: 1.22;
  margin-bottom: 12px;
}

.detail-lead {
  font-size: 0.98rem;
  color: #2b343b;
  margin: 0 0 18px;
  line-height: 1.62;
}

.mobile-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 22px;
}

.mobile-spec-grid small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.mobile-spec-grid strong {
  font-size: 0.88rem;
  color: var(--text);
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.detail-section p {
  margin: 0;
  color: #333e47;
  line-height: 1.65;
  font-size: 0.95rem;
}

.usage-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.usage-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.94rem;
  color: #2f3a43;
}

.step-num {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.mobile-download-box {
  margin: 24px 0 28px;
}

.btn-download-dark {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  border: none;
  border-radius: 12px;
  background: var(--dark-btn);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
}

.btn-download-dark:hover {
  background: var(--dark-slate);
}

.btn-download-dark svg {
  width: 20px;
  height: 20px;
}

.mobile-secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.btn-soft-action {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-soft-action.active {
  background: #fff7e6;
  border-color: #f0b429;
  color: #8c5a00;
}

/* Related list */
.sidebar-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.sidebar-card h3 {
  font-size: 1.04rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.related-item:hover {
  background: var(--surface);
}

.related-item img {
  width: 62px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-warm);
}

.related-info strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.28;
  margin-bottom: 2px;
}

.related-info span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ==========================================================================
   CATEGORIES, SEARCH, DOWNLOADS, PROFILE VIEWS
   ========================================================================== */

.page-intro {
  padding: 20px 0 16px;
}

.page-intro h1 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.page-intro p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.category-tile {
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: all 0.16s ease;
}

.category-tile:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.category-tile.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.cat-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.category-tile strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.category-tile small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.filter-bar-panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.filter-bar-panel h2 {
  font-size: 1.15rem;
}

.filter-bar-panel p {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Search Controls */
.search-controls-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 22px;
}

.search-controls-card .home-search-form {
  background: #fff;
  border: 1px solid var(--border);
}

.quick-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tag-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.78rem;
  cursor: pointer;
}

.tag-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.search-filters-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.search-filters-grid label span {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.search-filters-grid select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.88rem;
  color: var(--text);
}

.search-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Downloads & Profile Rows */
.download-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.download-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.download-row-main img {
  width: 72px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-warm);
}

.download-row-main h3 {
  font-size: 0.96rem;
  margin: 2px 0;
}

.download-row-main small {
  color: var(--text-light);
  font-size: 0.78rem;
}

/* Profile */
.profile-hero-card {
  margin-top: 18px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface-warm);
  border: 1px solid #ede5d8;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--dark-slate);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-school {
  margin: 4px 0 8px;
  font-weight: 600;
  color: var(--primary);
  font-size: 0.9rem;
}

.profile-bio {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.profile-stats-row {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
}

.profile-stats-row strong {
  display: block;
  font-size: 1.3rem;
}

.profile-stats-row span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.profile-edit-form {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 12px 0;
}

.profile-edit-form label span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-edit-form input,
.profile-edit-form select,
.profile-edit-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-size: 0.92rem;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* Shared Buttons */
.btn-primary-teal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.14s ease;
}

.btn-primary-teal:hover {
  background: var(--primary-hover);
}

.btn-primary-teal svg {
  width: 18px;
  height: 18px;
}

.btn-primary-teal.full-width {
  width: 100%;
}

.btn-outline-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.94rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-outline-slate,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-outline-slate:hover,
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-slate.active {
  background: #fff7e6;
  border-color: #f0b429;
  color: #8c5a00;
}

.btn-link {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Empty & Skeleton */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border-radius: var(--radius-md);
}

.empty-state.compact {
  padding: 28px 18px;
}

.empty-state p {
  color: var(--text-muted);
  margin: 8px 0 16px;
}

.loading-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px 0;
}

.skeleton-card {
  height: 110px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, #f2f3f5 25%, #e8eaee 50%, #f2f3f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Footer (Hidden on small mobile to keep native app feel, shown on tablet/desktop) */
.site-footer {
  display: none;
}

/* Toast */
.toast-banner {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  background: var(--dark-slate);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 120;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   DESKTOP & TABLET ENHANCED LAYOUT (>= 900px — Matches & Elevates Screen 3)
   ========================================================================== */

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
    background: #fcfcfd;
  }

  .desktop-only {
    display: block !important;
  }

  .mobile-only,
  .mobile-header,
  .mobile-bottom-nav {
    display: none !important;
  }

  .container {
    padding: 0 28px;
  }

  /* Desktop Header */
  .desktop-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }

  .desktop-header-inner {
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }

  .brand-icon svg {
    width: 34px;
    height: 34px;
  }

  .brand-text strong {
    display: block;
    font-size: 1.24rem;
    font-weight: 800;
    line-height: 1.05;
    color: var(--dark-slate);
  }

  .brand-text small {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .desktop-nav-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    position: relative;
    transition: all 0.16s ease;
  }

  .desktop-nav-item svg {
    width: 19px;
    height: 19px;
  }

  .desktop-nav-item:hover {
    background: var(--surface);
    color: var(--text);
  }

  .desktop-nav-item.active {
    color: var(--primary);
    background: var(--primary-soft);
  }

  .nav-pill-count {
    position: absolute;
    top: 4px;
    right: 8px;
    font-style: normal;
    font-size: 0.65rem;
    font-weight: 800;
    background: var(--primary);
    color: #fff;
    padding: 1px 5px;
    border-radius: 999px;
  }

  /* Desktop Hero Banner */
  .hero-banner-wrap {
    display: block;
    padding-top: 24px;
  }

  .hero-banner {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 40px;
    box-shadow: var(--shadow-md);
  }

  .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(22, 44, 53, 0.78) 0%, rgba(22, 44, 53, 0.56) 55%, rgba(44, 125, 160, 0.52) 100%);
  }

  .hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    color: #fff;
  }

  .hero-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 5px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
  }

  .hero-content h1 {
    color: #fff;
    font-size: 2.35rem;
    line-height: 1.16;
    margin-bottom: 12px;
  }

  .hero-content p {
    margin: 0 auto 22px;
    max-width: 600px;
    font-size: 1.04rem;
    color: rgba(255, 255, 255, 0.92);
  }

  .hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
  }

  .hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.88);
  }

  /* Search strip desktop */
  .search-strip-section {
    padding-top: 22px;
  }

  .home-search-form {
    padding: 6px 8px 6px 18px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }

  .search-submit-btn {
    display: inline-flex;
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    background: var(--dark-slate);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
  }

  .search-submit-btn:hover {
    background: var(--primary);
  }

  /* Featured 3-column grid on Desktop */
  .featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    overflow: visible;
  }

  .featured-card {
    max-width: none;
    background: #fff;
    border: 1px solid var(--border);
    padding: 14px;
    box-shadow: var(--shadow-sm);
  }

  .featured-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #d2dce2;
  }

  .featured-body h3 {
    font-size: 1.08rem;
    margin-bottom: 5px;
  }

  .featured-body p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.4;
  }

  /* New Resources 4-column Card Grid on Desktop */
  .resources-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }

  .resource-card {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }

  .resource-card:last-child {
    border-bottom: 1px solid var(--border);
  }

  .resource-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #cdd8df;
  }

  .resource-thumb {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #f0f2f4;
  }

  .badge-grade-overlay {
    position: absolute;
    left: 10px;
    bottom: 10px;
    background: rgba(22, 44, 53, 0.82);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
  }

  .resource-info {
    padding: 14px 15px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .resource-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f2f4f6;
    justify-content: space-between;
  }

  /* Desktop Post Detail 2-column layout (Matches & Elevates Screen 3) */
  .detail-container {
    padding-top: 24px;
    padding-bottom: 48px;
  }

  .breadcrumbs {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 18px;
  }

  .breadcrumbs a:hover {
    color: var(--primary);
    text-decoration: underline;
  }

  .breadcrumbs .current {
    color: var(--text);
    font-weight: 600;
  }

  .detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
    gap: 32px;
    align-items: start;
  }

  .detail-heading {
    margin-bottom: 20px;
  }

  .detail-heading h1 {
    font-size: 2rem;
    line-height: 1.18;
    margin-bottom: 10px;
  }

  .detail-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-muted);
  }

  .detail-hero-figure {
    margin: 0 0 24px;
    border-radius: var(--radius-lg);
    max-height: 460px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }

  .detail-hero-figure img {
    max-height: 460px;
  }

  .detail-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    margin-bottom: 20px;
  }

  .detail-sidebar {
    position: sticky;
    top: 96px;
  }

  .detail-dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .detail-dl > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
    padding-bottom: 8px;
    border-bottom: 1px solid #f2f4f6;
  }

  .detail-dl > div:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .detail-dl dt {
    color: var(--text-muted);
  }

  .detail-dl dd {
    margin: 0;
    font-weight: 700;
    color: var(--text);
    text-align: right;
  }

  .access-card {
    background: linear-gradient(180deg, #ffffff 0%, #f5fafc 100%);
    border-color: #d3e6ef;
  }

  .access-note {
    margin: 10px 0 14px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  .sidebar-extra-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* Categories & Search desktop grids */
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .search-filters-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }

  .filter-bar-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
  }

  .profile-hero-card {
    flex-direction: row;
    align-items: flex-start;
    padding: 30px;
  }

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

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

  .skeleton-card {
    height: 260px;
  }

  /* Desktop Footer */
  .site-footer {
    display: block;
    margin-top: 64px;
    background: var(--dark-slate);
    color: rgba(255, 255, 255, 0.82);
    padding: 48px 0 28px;
  }

  .footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .footer-logo strong {
    display: block;
    font-size: 1.35rem;
    color: #fff;
  }

  .footer-logo span {
    font-size: 0.78rem;
    color: #70c1b3;
    font-weight: 600;
  }

  .footer-brand p {
    margin: 12px 0 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.72);
    max-width: 320px;
  }

  .footer-col h4 {
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 12px;
  }

  .footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .footer-col a {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.74);
    transition: color 0.15s ease;
  }

  .footer-col a:hover {
    color: #70c1b3;
  }

  .footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 22px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.62);
  }

  .footer-bottom p {
    margin: 0;
  }

  .toast-banner {
    bottom: 28px;
  }
}


/* ==========================================================================
   AUTH LEAD MODAL & ENHANCED PROFILE STYLES
   ========================================================================== */

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 44, 53, 0.56);
  backdrop-filter: blur(4px);
  z-index: 140;
}

.auth-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(470px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(15, 32, 40, 0.28);
  padding: 24px 22px 22px;
  z-index: 150;
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal-close:hover {
  background: #e5e8ec;
}

.auth-modal-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  border: 1px solid #ebe2d4;
  margin: 0 28px 16px 0;
}

.auth-modal-preview img {
  width: 56px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.auth-preview-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.auth-modal-preview strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.25;
}

.auth-modal-preview small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auth-modal-header h2 {
  font-size: 1.32rem;
  margin-bottom: 6px;
  padding-right: 24px;
}

.auth-modal-header p {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--surface);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.auth-tabs button {
  padding: 9px 10px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--dark-slate);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.auth-error-alert {
  background: #fdf0ee;
  border: 1px solid #f5c6c0;
  color: #a62b1f;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form label span {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.auth-form label span em {
  color: var(--accent-new);
  font-style: normal;
}

.auth-form label span small {
  font-weight: 500;
  color: var(--text-light);
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.92rem;
  color: var(--text);
  outline: none;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 125, 160, 0.12);
}

.auth-optional-divider {
  text-align: center;
  position: relative;
  margin: 4px 0 0;
}

.auth-optional-divider span {
  font-size: 0.74rem;
  color: var(--text-light);
  background: #fff;
  padding: 0 8px;
}

.auth-optional-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-submit-btn {
  margin-top: 4px;
  padding: 13px 18px;
}

.auth-footnote {
  margin: 2px 0 0;
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-light);
}

/* Profile Guest & Enhanced Fields */
.profile-guest-card {
  margin-top: 22px;
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-warm);
  border: 1px solid #ede5d8;
  text-align: center;
}

.profile-guest-card h1 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.profile-guest-card p {
  margin: 0 auto 22px;
  max-width: 520px;
  color: var(--text-muted);
}

.guest-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-meta {
  flex: 1;
}

.profile-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.profile-email {
  margin: 2px 0 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.profile-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.ip-pill {
  background: #eef2f5;
  color: #46545f;
}

.profile-edit-hint {
  margin: 0 0 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.danger-link {
  color: #b83a2d;
}

.profile-bio.muted {
  color: var(--text-light);
  font-style: italic;
}

@media (max-width: 500px) {
  .auth-optional-grid {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   GLOBAL LOADING BAR, NG-CLOAK & COMPONENT SKELETONS
   ========================================================================== */

[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak {
  display: none !important;
}

.top-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  overflow: hidden;
  background: rgba(44, 125, 160, 0.14);
}

.top-loading-bar.is-active {
  opacity: 1;
}

.top-loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--primary), #70c1b3, transparent);
  animation: topBarSlide 1.1s ease-in-out infinite;
}

@keyframes topBarSlide {
  0% { left: -40%; }
  100% { left: 100%; }
}

.view-fade-in {
  animation: viewFadeIn 0.24s ease-out;
}

@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shimmer Base */
.sk-box {
  background: linear-gradient(90deg, #f0f2f4 25%, #e5e8ec 50%, #f0f2f4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.25s infinite linear;
  border-radius: 8px;
}

.skeleton-heading {
  width: 190px;
  height: 24px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, #f0f2f4 25%, #e5e8ec 50%, #f0f2f4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.25s infinite linear;
}

.sk-line {
  height: 14px;
  margin-bottom: 10px;
}

.sk-line.xs { width: 34%; height: 11px; }
.sk-line.sm { width: 48%; height: 14px; }
.sk-line.md { width: 72%; height: 14px; }
.sk-line.lg { width: 92%; height: 15px; }
.sk-line.xl { width: 82%; height: 28px; }

.sk-btn-lg {
  width: 100%;
  height: 46px;
  border-radius: 10px;
}

.sk-btn-sm {
  width: 170px;
  height: 40px;
  border-radius: 10px;
}

/* Featured Skeleton */
.skeleton-featured-card {
  flex: 0 0 74%;
  max-width: 280px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.sk-thumb-lg {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  margin-bottom: 12px;
}

/* Resource Card Skeleton (Mobile horizontal row, Desktop vertical card) */
.skeleton-resource-card {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f2f4;
}

.sk-res-thumb {
  flex: 0 0 116px;
  width: 116px;
  height: 86px;
  border-radius: 12px;
}

.sk-res-body {
  flex: 1;
}

/* Detail Skeleton */
.skeleton-hero {
  width: 100%;
  height: 260px;
  border-radius: var(--radius-md);
}

.skeleton-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

/* Profile Skeleton */
.profile-skeleton-card {
  margin-top: 18px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-warm);
  border: 1px solid #ede5d8;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sk-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sk-profile-body {
  flex: 1;
}

@media (min-width: 900px) {
  .skeleton-featured-card {
    max-width: none;
    padding: 14px;
  }

  .skeleton-resource-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .sk-res-thumb {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 0;
  }

  .sk-res-body {
    padding: 14px 15px 10px;
  }

  .skeleton-hero {
    height: 380px;
    border-radius: var(--radius-lg);
  }

  .profile-skeleton-card {
    flex-direction: row;
    align-items: flex-start;
    padding: 30px;
  }
}


/* ==========================================================================
   MINIMALIST BACKOFFICE (/backoffice)
   ========================================================================== */

body.is-backoffice {
  padding-bottom: 0;
  background: #f6f7f9;
}

.bo-root {
  min-height: 100vh;
}

/* Admin Login */
.bo-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(180deg, #faf7f2 0%, #f3f6f8 100%);
}

.bo-login-card {
  width: min(410px, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-md);
}

.bo-back-public {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.bo-back-public:hover {
  color: var(--primary);
}

.bo-brand-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--dark-slate);
  color: #fff;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.bo-login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.bo-login-card p {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Backoffice Shell */
.bo-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.bo-sidebar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bo-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bo-logo strong {
  display: block;
  font-size: 1.12rem;
  color: var(--dark-slate);
  line-height: 1.1;
}

.bo-logo span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bo-new-btn {
  padding: 8px 14px;
  font-size: 0.84rem;
}

.bo-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.bo-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.15s ease;
}

.bo-nav a svg {
  width: 18px;
  height: 18px;
}

.bo-nav a:hover {
  background: var(--surface);
  color: var(--text);
}

.bo-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.bo-sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid #f0f2f4;
}

.bo-admin-pill strong {
  display: block;
  font-size: 0.84rem;
}

.bo-admin-pill small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.bo-footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bo-footer-links a,
.bo-footer-links button {
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.bo-footer-links a:hover { color: var(--primary); }
.bo-footer-links button:hover { color: #b83a2d; }

/* Main area */
.bo-main {
  flex: 1;
  padding: 20px 16px 48px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}

.bo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.bo-header h1 {
  font-size: 1.65rem;
}

.bo-header p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.bo-back-inline {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}

.bo-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(22, 44, 53, 0.04);
}

.bo-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.bo-card-head h3 {
  font-size: 1rem;
  font-weight: 800;
}

/* KPIs */
.bo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.bo-kpi span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.bo-kpi strong {
  display: block;
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--dark-slate);
  margin: 4px 0 2px;
  line-height: 1.1;
}

.bo-kpi small {
  font-size: 0.76rem;
  color: var(--text-light);
}

/* 7-day bar chart */
.bo-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.bo-legend {
  display: flex;
  gap: 12px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.bo-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 4px;
}

.dot-views { background: #8bbbd1; }
.dot-downloads { background: var(--primary); }

.bo-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  height: 190px;
  align-items: end;
  padding-top: 22px;
}

.bo-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 8px;
}

.bo-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  width: 100%;
  justify-content: center;
}

.bo-bar {
  width: 14px;
  border-radius: 5px 5px 2px 2px;
  position: relative;
  transition: height 0.35s ease;
}

.bo-bar.views { background: #b5d5e4; }
.bo-bar.downloads { background: var(--primary); }

.bo-bar span {
  position: absolute;
  top: -17px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bo-chart-col small {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Category rows */
.bo-cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bo-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f2f4f6;
}

.bo-cat-row:last-child { border-bottom: none; padding-bottom: 0; }

.bo-cat-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bo-cat-info .cat-dot { margin: 0; flex-shrink: 0; }
.bo-cat-info strong { font-size: 0.88rem; }
.bo-cat-info small { font-size: 0.75rem; color: var(--text-light); }

.bo-cat-nums {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.bo-cat-nums span { color: var(--text-muted); }

/* Top Downloaded */
.bo-top-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bo-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f2f4f6;
}

.bo-top-row:last-child { border-bottom: none; padding-bottom: 0; }

.bo-top-row img {
  width: 56px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-warm);
}

.bo-top-main {
  flex: 1;
  min-width: 0;
}

.bo-top-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bo-top-title-line strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bo-inline-edit {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.bo-top-main small {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 2px 0 6px;
}

.bo-progress-track {
  height: 6px;
  background: #edf1f4;
  border-radius: 999px;
  overflow: hidden;
}

.bo-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.bo-top-metrics {
  display: flex;
  gap: 14px;
  text-align: right;
  flex-shrink: 0;
}

.bo-top-metrics strong { display: block; font-size: 0.92rem; }
.bo-top-metrics small { font-size: 0.7rem; color: var(--text-light); }

/* Resources Toolbar & List */
.bo-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.bo-toolbar input,
.bo-toolbar select {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.9rem;
}

.bo-resource-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bo-resource-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.bo-resource-item img {
  width: 72px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.bo-res-info {
  flex: 1;
  min-width: 200px;
}

.bo-res-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.bo-tag-soft {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 6px;
}

.bo-tag-accent {
  font-size: 0.7rem;
  font-weight: 700;
  background: #fff4db;
  color: #8c5a00;
  padding: 2px 8px;
  border-radius: 6px;
}

.bo-res-info h3 {
  font-size: 0.98rem;
  margin-bottom: 2px;
}

.bo-res-info p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.bo-res-stats {
  display: flex;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bo-res-stats strong {
  color: var(--text);
}

.bo-res-actions {
  display: flex;
  gap: 6px;
}

.btn-danger-soft {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #f5c6c0;
  background: #fff5f4;
  color: #a62b1f;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger-soft:hover {
  background: #fde5e2;
}

/* Ultra-clean Editor */
.bo-editor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.bo-editor-main,
.bo-editor-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bo-editor-side h3 {
  font-size: 0.96rem;
  margin-bottom: 12px;
}

.bo-field {
  display: block;
  margin-bottom: 14px;
}

.bo-field:last-child {
  margin-bottom: 0;
}

.bo-field span {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text);
}

.bo-field em {
  color: var(--accent-new);
  font-style: normal;
}

.bo-field input,
.bo-field select,
.bo-field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.92rem;
  color: var(--text);
  outline: none;
}

.bo-field input:focus,
.bo-field select:focus,
.bo-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 125, 160, 0.1);
}

.bo-field-pair {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}

.bo-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f2f4;
}

.bo-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.bo-steps-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bo-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bo-step-row input {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}

.bo-step-del {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.bo-upload-preview {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 10px;
  background: var(--surface-warm);
}

.bo-upload-preview img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.bo-current-file {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  margin-bottom: 10px;
}

.bo-current-file strong {
  display: block;
  font-size: 0.84rem;
  color: var(--primary);
  word-break: break-all;
}

.bo-current-file small {
  font-size: 0.74rem;
  color: var(--text-muted);
  word-break: break-all;
}

.bo-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px 12px;
  border-radius: 12px;
  border: 1.5px dashed #c7d2da;
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bo-dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.bo-dropzone input {
  display: none;
}

.bo-dropzone strong {
  font-size: 0.86rem;
  color: var(--dark-slate);
}

.bo-dropzone small {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Teachers Table */
.bo-table-wrap {
  overflow-x: auto;
  padding: 0;
}

.bo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.bo-table th {
  text-align: left;
  padding: 13px 16px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.bo-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f0f2f4;
  vertical-align: top;
}

.bo-table td strong,
.bo-table td span {
  display: block;
}

.bo-table td small {
  font-size: 0.76rem;
  color: var(--text-muted);
}

@media (min-width: 900px) {
  .bo-shell {
    flex-direction: row;
  }

  .bo-sidebar {
    width: 248px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 22px 16px;
  }

  .bo-sidebar-top {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 8px;
  }

  .bo-nav {
    flex-direction: column;
    overflow: visible;
  }

  .bo-sidebar-footer {
    margin-top: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 14px;
  }

  .bo-main {
    padding: 30px 36px 56px;
  }

  .bo-kpi-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .bo-two-col {
    grid-template-columns: 1.25fr 1fr;
  }

  .bo-toolbar {
    grid-template-columns: 2fr 1fr;
  }

  .bo-editor-grid {
    grid-template-columns: 1.65fr 1fr;
  }
}


/* Google SERP Preview in Backoffice */
.bo-serp-preview {
  padding: 14px 16px;
  border-radius: 10px;
  background: #fafbfc;
  border: 1px solid #e9edf1;
}

.serp-url {
  font-size: 0.76rem;
  color: #3c4043;
  margin-bottom: 3px;
  word-break: break-all;
}

.serp-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a0dab;
  line-height: 1.3;
  margin-bottom: 4px;
}

.serp-desc {
  font-size: 0.84rem;
  color: #4d5156;
  line-height: 1.45;
}
