/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Cairo:wght@300;400;600;700;900&display=swap');

:root {
  /* ── Core palette (prototype exact values) ── */
  --bg:             #f7f9fc;
  --surface:        #ffffff;
  --surface-soft:   #f0f6ff;
  --text:           #111827;
  --text-secondary: #374151;
  --muted:          #6b7280;
  --muted-light:    #9ca3af;
  --line:           #e5e7eb;
  --line-strong:    #d1d5db;
  --primary:        #0d57a7;
  --primary-dark:   #0b4a91;
  --primary-light:  #dbeafe;
  --primary-faint:  #f0f6ff;
  --success:        #059669;
  --success-light:  #d1fae5;
  --amber:          #d97706;
  --amber-light:    #fef3c7;
  --violet:         #7c3aed;
  --violet-light:   #ede9fe;
  --teal:           #0891b2;
  --teal-light:     #cffafe;
  /* ── Legacy tokens kept for backward compat ── */
  --secondary:      #a7cf38;
  --accent:         #22b7b9;
  /* ── Shadows ── */
  --shadow:         0 4px 16px rgba(13,87,167,.10);
  --shadow-sm:      0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:      0 4px 16px rgba(13,87,167,.10);
  --shadow-lg:      0 8px 32px rgba(13,87,167,.14);
  /* ── Radius ── */
  --radius:         16px;
  --radius-sm:      8px;
  --radius-md:      12px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  /* ── Layout ── */
  --max:            1200px;
  /* ── Extra tokens (article-detail) ── */
  --text-soft:      #374151;
  --radius-xs:      4px;
  --mobile-nav-h:   64px;
  --font:           'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --warning:        #d97706;
  --warning-light:  #fef3c7;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; }
input, textarea, select { width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--radius-md); padding: .75rem 1rem; background: #fff; outline: none; transition: border-color .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,87,167,.08); }
textarea { resize: vertical; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
h1, h2, h3, h4, p, li, span, strong, a, dt, dd { overflow-wrap: anywhere; }
main, section, article, aside, div { min-width: 0; }
/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  display: flex; align-items: center;
  gap: 0.75rem; height: 62px;
}
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; text-decoration: none; }
.brand__image {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  object-fit: cover; object-position: center;
}
.nav-spacer { flex: 1; }
.desktop-nav, .lang-switcher { display: flex; align-items: center; gap: .25rem; margin-left: 1.25rem; }
.desktop-nav a, .lang-switcher button {
  padding: .375rem .75rem; border-radius: var(--radius-sm);
  color: var(--muted); background: transparent; border: 0;
  cursor: pointer; font-size: .875rem; font-weight: 500;
  transition: color .15s, background .15s;
}
.desktop-nav a:hover, .lang-switcher button:hover { background: var(--bg); color: var(--text); }
.desktop-nav a.active, .lang-switcher button.active { background: var(--primary-faint); color: var(--primary); font-weight: 600; }

/* Icon-only nav buttons (header right side) */
.nav-icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--muted);
  text-decoration: none; transition: color .15s, background .15s;
  flex-shrink: 0; background: transparent; border: none;
}
.nav-icon-btn:hover { color: var(--text); background: var(--bg); }

/* Cart badge inside nav-icon-btn */
.nav-icon-btn .cart-badge,
.nav-icon-btn[data-cart-link] .cart-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; font-size: 0.6rem;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border-radius: var(--radius-sm); padding: .625rem 1.25rem;
  border: none; cursor: pointer; font-family: inherit;
  font-size: .875rem; font-weight: 600; white-space: nowrap;
  transition: all .18s;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn--secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--line-strong); }
.btn--secondary:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn--light { background: var(--surface); color: var(--text); border: 1.5px solid var(--line-strong); }
.btn--light:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn--ghost { background: transparent; color: var(--primary); }
.btn--ghost:hover { background: var(--primary-faint); }
.btn--sm { padding: .45rem .875rem; font-size: .8rem; }
.btn--full { width: 100%; }
.btn--icon { padding: .5rem; position: relative; font-size: 0; }
.btn--icon svg { width: 20px; height: 20px; display: block; }
.btn--cart { position: relative; }

/* Global cart badge (for pages not using nav-icon-btn) */
.cart-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--primary); color: #fff;
  font-size: 0.65rem; font-weight: 700;
}
.hero { padding: 2rem 0 1rem; }
.hero__grid, .split-grid, .product-layout, .order-layout, .footer-grid, .info-grid { display: grid; gap: 1.1rem; }
.hero__grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); align-items: start; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .75rem; border-radius: 999px; background: #e8f3ff; color: var(--primary); font-size: .88rem; font-weight: 700; }
.hero h1 { font-size: clamp(2rem, 5vw, 4rem); line-height: 1.05; margin: .9rem 0 .8rem; }
.lead { font-size: 1.02rem; line-height: 1.75; color: var(--muted); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.3rem 0 1rem; }
.trust-row { display: flex; flex-wrap: wrap; gap: .65rem; }
.trust-row span, .mini-badge { padding: .65rem .9rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.panel { background: var(--surface); border: 1px solid rgba(216, 228, 241, .95); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.2rem; }
.hero-card { padding: 1.35rem; }
.hero-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; }
.hero-card ol { margin: 1rem 0 0 1.2rem; color: var(--muted); line-height: 1.8; }
.section { padding: 1.25rem 0 2rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head--stack { align-items: start; }
.text-link { color: var(--primary); font-weight: 700; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.product-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.product-card__media { aspect-ratio: 4 / 3; background: #f0f4fa; overflow: hidden; }
.product-card__media img { width: 100%; height: 100%; object-fit: cover; }
.product-card__body { padding: 1.1rem; display: grid; gap: .8rem; flex: 1; }
.product-card__body h3 { margin: 0; font-size: 1.12rem; }
.product-card__body p { margin: 0; color: var(--muted); line-height: 1.7; }
.product-card__footer { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: auto; }
.tag { display: inline-flex; width: fit-content; padding: .38rem .65rem; border-radius: 999px; background: #eef8ea; color: #648b08; font-weight: 700; font-size: .82rem; }
.info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.info-card h3 { margin-top: 0; }
.info-card p { color: var(--muted); line-height: 1.75; }
.split-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr); align-items: start; }
.contact-card p, .faq-copy p { color: var(--muted); line-height: 1.8; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
.product-layout { grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); align-items: start; }
.product-gallery { overflow: visible; padding: 0; }
.gallery-carousel { display: flex; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; gap: 0; width: 100%; border-radius: 18px; }\n.gallery-carousel::-webkit-scrollbar { height: 6px; }
.gallery-carousel::-webkit-scrollbar-track { background: transparent; }
.gallery-carousel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.3); border-radius: 10px; }
.gallery-carousel::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.5); }
.carousel-slide { flex-shrink: 0; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 18px; }
.product-details h1 { margin: .6rem 0; font-size: clamp(1.7rem, 3vw, 2.5rem); }
.price-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.price-row strong { font-size: 1.35rem; color: var(--primary-dark); }
.stock-pill { background: #eef8ea; color: #648b08; border-radius: 999px; padding: .42rem .75rem; font-weight: 700; }
.option-stack { display: grid; gap: .85rem; margin: 1rem 0; }
.option-stack label span, .form-grid label span { display: block; margin-bottom: .45rem; font-weight: 700; }
.helper-text { color: var(--muted); margin: .8rem 0 0; }
.details-list ul { margin: .6rem 0 0 1.1rem; color: var(--muted); line-height: 1.8; }
.product-reviews { margin-top: 1rem; }
.reviews-stack { display: grid; gap: 1rem; }
.review-card__top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.filters { display: flex; gap: .7rem; flex-wrap: wrap; }
.filters > * { flex: 1 1 200px; }
.empty-state { text-align: center; padding: 2rem 1.2rem; }
.order-layout { grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr); align-items: start; }
.notice-box { background: #f0f7ff; border: 1px solid var(--line); padding: 1rem; border-radius: 18px; margin: 1rem 0; }
.notice-box p { margin-bottom: 0; color: var(--muted); }
.summary-box dl { margin: 0; display: grid; gap: .7rem; }
.summary-box div { display: flex; justify-content: space-between; gap: .8rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.summary-box dt { color: var(--muted); }
.summary-box dd { margin: 0; font-weight: 700; text-align: end; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.form-grid .full { grid-column: 1 / -1; }
.status { margin-top: 1rem; padding: .95rem 1rem; border-radius: 14px; }
.status--success { background: #edf9ef; color: #216437; border: 1px solid #b7e2c0; }
/* ── Mobile nav ─────────────────────────────────────────────── */
.mobile-nav {
  position: fixed; bottom: 0; left: 0; right: 0; width: 100%;
  z-index: 40; display: none;
  justify-content: space-around;
  padding: 0.5rem 1rem calc(0.5rem + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
}
.mobile-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  font-size: 0.65rem; font-weight: 500; color: var(--muted);
  padding: 0.4rem 0.625rem; text-decoration: none;
}
.mobile-nav a.active { color: var(--primary); }
.mobile-nav svg { width: 20px; height: 20px; display: block; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--text); color: rgba(255,255,255,.7);
  padding: 3rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.site-footer h3 { font-size: 1.1rem; font-weight: 800; color: #fff; margin: 0 0 0.5rem; }
.site-footer h4 { font-size: 0.8rem; font-weight: 700; color: #fff; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 0.75rem; }
.site-footer p { font-size: 0.82rem; line-height: 1.6; color: rgba(255,255,255,.7); margin: 0; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; color: rgba(255,255,255,.7); font-size: 0.82rem; line-height: 1.8; }
.site-footer li a { color: rgba(255,255,255,.6); font-weight: 400; text-decoration: none; transition: color .15s; }
.site-footer li a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.25rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,.5);
}

[dir='rtl'] body { font-family: 'Cairo', sans-serif; }
[dir='rtl'] .summary-box dd { text-align: start; }

/* Filter Chips for Medical Corner */
.filter-chip {
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s ease;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
}

.filter-chip:hover {
  background: #eaf2ff;
  color: var(--primary);
  border-color: var(--primary);
}

.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Inquiry page responsive layout */
.inquiry-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 2rem; align-items: start; }
.inquiry-info { display: flex; flex-direction: column; }
.inquiry-info-box { background: #eaf2ff; border-radius: 18px; padding: 1.5rem; margin-bottom: 1.5rem; border: 1px solid rgba(13, 87, 167, 0.15); }
.inquiry-info-box h3 { margin: 0 0 1rem 0; color: var(--primary); font-size: 1.1rem; }
.inquiry-info-box ul { margin: 0; padding-left: 1.5rem; color: var(--text); line-height: 1.8; }
.inquiry-form-wrapper { display: flex; flex-direction: column; }
#inquiry-form .form-grid { margin-bottom: 1.5rem; }
#inquiry-form .btn { margin-top: 0.5rem; }

@media (max-width: 1024px) {
  .hero__grid, .split-grid, .product-layout, .order-layout { grid-template-columns: 1fr; }
  .product-grid, .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
@media (max-width: 640px) {
  .desktop-nav { display: none; }
  .mobile-nav { display: flex; }
}
@media (max-width: 768px) {
  .btn--sm.header-wa { display: none; }
  body { padding-bottom: 60px; }
  .product-grid, .info-grid, .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .inquiry-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.3rem; }
  .section-head { flex-direction: column; align-items: start; }
  .hero__actions .btn, .contact-actions .btn { width: 100%; }
  .trust-row span { width: 100%; justify-content: center; text-align: center; }
  .brand { max-width: 100%; }
  [style*="grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr)"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* Loading and error state UI polish */
.empty-state .btn,
.status .btn {
  margin-top: 0.75rem;
}

.review-card__top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.reviews-stack {
  display: grid;
  gap: 1rem;
}

.faq-stack {
  display: grid;
  gap: 1rem;
}

.steps-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.cta-card {
  text-align: center;
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.section-heading h1 {
  font-size: 2rem;
}

/* University resources page */
.univ-res-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.univ-res-hero h2 {
  margin: 0 0 0.4rem 0;
}

.univ-res-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.univ-year-tabs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.univ-year-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

.univ-year-tab.active,
.univ-year-tab:hover {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
}

.univ-year-header {
  margin-bottom: 1rem;
}

.univ-year-header h2 {
  margin: 0 0 0.35rem 0;
}

.univ-year-header p {
  margin: 0;
  color: var(--muted);
}

.univ-res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.univ-res-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
}

.univ-res-card h3 {
  margin: 0 0 0.65rem 0;
  color: var(--primary);
  font-size: 1.05rem;
}

.univ-res-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.univ-res-card li a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  background: #fff;
  transition: 0.2s ease;
}

.univ-res-card li a:hover {
  background: #eef6ff;
  color: var(--primary);
  border-color: #bad2ea;
}

.univ-res-item {
  display: flex;
  gap: 0.45rem;
  align-items: stretch;
}

.univ-res-item__link {
  flex: 1;
  text-decoration: none;
}

.univ-res-item__title {
  display: block;
  font-weight: 600;
}

.univ-res-item__desc {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.univ-res-item__testimony-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0d57a7;
  background: #e9f2ff;
  border: 1px solid #c4ddfb;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

.univ-res-item__ext {
  width: 2.2rem;
  min-width: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
}

.univ-res-item__ext:hover {
  background: #eef6ff;
  color: var(--primary);
  border-color: #bad2ea;
}

.univ-year-empty {
  margin: 0;
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 1rem;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.residanat-focus {
  margin-top: 1rem;
  border: 1px solid rgba(13, 87, 167, 0.22);
  background: linear-gradient(135deg, #f6fbff, #eef7ff);
}

.residanat-focus__head h3 {
  margin: 0 0 0.35rem 0;
  color: var(--primary);
  font-size: 1.15rem;
}

.residanat-focus__head p {
  margin: 0;
  color: var(--muted);
}

.residanat-focus__links {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem;
}

.residanat-focus__links a {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  font-weight: 600;
}

.residanat-focus__links a:hover {
  border-color: #bad2ea;
  background: #f0f8ff;
  color: var(--primary);
}

@media (max-width: 768px) {
  .univ-res-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .univ-res-grid {
    grid-template-columns: 1fr;
  }
}

.resource-submit-form {
  display: grid;
  gap: 0.75rem;
}

.resource-submit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.resource-submit-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--text);
}

.resource-submit-form input,
.resource-submit-form select,
.resource-submit-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.resource-submit-years-title {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.resource-submit-years {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
}

.resource-submit-year {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  background: #fff;
}

.resource-moderation-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: end;
}

.resource-moderation-filters label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
}

.resource-moderation-filters select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
}

.resource-moderation-table-wrap {
  overflow-x: auto;
}

.resource-moderation-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.resource-moderation-table th,
.resource-moderation-table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 0.55rem 0.5rem;
  vertical-align: top;
}

.resource-row-actions {
  display: grid;
  gap: 0.35rem;
}

.resource-row-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}

.resource-row-actions button.danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff1f2;
}

@media (max-width: 960px) {
  .resource-submit-grid {
    grid-template-columns: 1fr;
  }

  .resource-moderation-filters {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Mobile nav icon variant ────────────────────────────────────────────── */
.mobile-nav--icons a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.62rem;
  font-weight: 500;
  padding: 0.35rem 0.5rem;
}
.mobile-nav--icons a svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Resource navigation hub ─────────────────────────────────────────────── */
:root {
  --annexe-color: #6d28d9;
  --annexe-light: #ede9fe;
}

/* Breadcrumb */
.res-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: .25rem;
  font-size: .8rem; color: var(--muted); margin-bottom: 1.75rem;
}
.res-bc-btn {
  color: var(--primary); font-size: .8rem; font-weight: 500;
  padding: .2rem .4rem; border-radius: 4px; background: none; border: none;
  cursor: pointer; transition: background .15s;
}
.res-bc-btn:hover { background: #eaf2ff; }
.res-bc-sep { color: var(--muted); font-size: .75rem; }
.res-bc-cur { color: var(--text); font-weight: 500; padding: .2rem .4rem; }

/* Page header */
.res-view { animation: resViewIn .22s ease both; }
@keyframes resViewIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.res-page-header { margin-bottom: 2rem; }
.res-page-title { font-size: clamp(1.4rem, 3.5vw, 1.9rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.2; color: var(--text); margin: .25rem 0 .5rem; }
.res-page-sub { color: var(--muted); font-size: .95rem; max-width: 560px; margin: 0; }
.res-section-title {
  font-size: .95rem; font-weight: 700; color: var(--text);
  margin-bottom: .75rem; display: flex; align-items: center; gap: .6rem;
}
.res-section-title::after { content:''; flex:1; height:1px; background:var(--line); }

/* Badges */
.res-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; flex-shrink: 0;
}
.res-badge--faculte  { background: #dbeafe; color: #1d4ed8; }
.res-badge--annexe   { background: var(--annexe-light); color: var(--annexe-color); }
.res-badge--pharmacie { background: #d1fae5; color: #065f46; }
.res-badge--dentaire { background: #fef3c7; color: #b45309; }

/* Category grid */
.res-category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: .5rem;
}
@media (max-width: 640px) { .res-category-grid { grid-template-columns: 1fr; } }
.res-category-card {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 1.75rem 1.5rem; cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
  display: flex; flex-direction: column; gap: 1rem; text-align: left; width: 100%;
  position: relative; overflow: hidden;
}
.res-category-card::before {
  content:''; position:absolute; inset:0; background:#eaf2ff; opacity:0; transition:opacity .18s;
}
.res-category-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(13,87,167,.1); transform: translateY(-2px); }
.res-category-card:hover::before { opacity:1; }
.res-category-card > * { position: relative; }
.res-category-card__icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.res-category-card__title { font-size: 1.1rem; font-weight: 700; letter-spacing: -.015em; color: var(--text); }
.res-category-card__meta { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.res-category-card__arrow { margin-top: auto; color: var(--primary); font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: .3rem; }

/* Faculty grid */
.res-faculty-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .875rem;
}
@media (max-width: 480px) { .res-faculty-grid { grid-template-columns: 1fr 1fr; gap: .625rem; } }
.res-faculty-card {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 1.125rem 1rem; cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column; gap: .5rem;
}
.res-faculty-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(13,87,167,.1); transform: translateY(-1px); }
.res-faculty-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.res-faculty-card__name { font-size: .95rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.res-faculty-card__annexe-count { font-size: .75rem; color: var(--muted); display: flex; align-items: center; gap: .25rem; }
.res-annexe-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--annexe-color); flex-shrink: 0; }
.res-faculty-card__cta { font-size: .78rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: .25rem; margin-top: .25rem; }

/* Annexe grid */
.res-annexe-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; margin-bottom: 2.5rem;
}
@media (max-width: 480px) { .res-annexe-grid { grid-template-columns: 1fr 1fr; gap: .625rem; } }
.res-annexe-card {
  background: var(--surface); border: 1.5px solid var(--annexe-light); border-radius: 12px;
  padding: 1rem; cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column; gap: .5rem;
}
.res-annexe-card:hover { border-color: var(--annexe-color); box-shadow: 0 4px 16px rgba(109,40,217,.1); transform: translateY(-1px); }
.res-annexe-card__name { font-size: .9rem; font-weight: 700; color: var(--text); }
.res-annexe-card__parent { font-size: .75rem; color: var(--muted); }
.res-annexe-card__cta { font-size: .75rem; font-weight: 600; color: var(--annexe-color); display: flex; align-items: center; gap: .25rem; margin-top: auto; }

/* Year filter pills */
.res-year-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.res-year-pill {
  padding: .375rem .875rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  transition: all .15s; font-family: inherit;
}
.res-year-pill:hover { border-color: var(--primary); color: var(--primary); }
.res-year-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Resource groups */
.res-resource-group { margin-bottom: 2rem; }
.res-resource-group__header { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.res-resource-group__icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0;
}
.res-resource-group__label { font-size: .875rem; font-weight: 700; color: var(--text); }
.res-resource-group__count {
  font-size: .75rem; color: var(--muted); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: .1rem .5rem; font-weight: 600;
}
.res-resource-list { display: flex; flex-direction: column; gap: .5rem; }
.res-resource-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: .875rem 1rem; display: flex; align-items: center; gap: .75rem;
  transition: border-color .15s, box-shadow .15s;
}
.res-resource-card:hover { border-color: var(--line-strong, #d1d5db); box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.res-resource-card__body { flex: 1; min-width: 0; }
.res-resource-card__title {
  font-size: .9rem; font-weight: 600; color: var(--text); display: block;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none;
}
.res-resource-card__title:hover { color: var(--primary); text-decoration: underline; }
.res-resource-card__desc { font-size: .78rem; color: var(--muted); margin-top: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-resource-card__badge {
  display: inline-block; margin-top: .3rem; font-size: .72rem; font-weight: 600;
  color: var(--primary); background: #eaf2ff; border-radius: 4px; padding: .1rem .4rem;
}
.res-resource-card__ext {
  flex-shrink: 0; color: var(--primary); display: flex; align-items: center; padding: .25rem;
  border-radius: 6px; transition: background .15s;
}
.res-resource-card__ext:hover { background: #eaf2ff; }

/* Empty state */
.res-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.res-empty__icon { font-size: 2.5rem; margin-bottom: .75rem; }
.res-empty__title { font-size: 1rem; font-weight: 600; margin-bottom: .25rem; color: var(--text); }
.res-empty__sub { font-size: .875rem; }
.res-year-loading { padding: 2rem 0; text-align: center; color: var(--muted); font-size: .9rem; }

/* Add resource banner */
.res-add-banner {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 1.125rem 1.25rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.res-add-banner__title { font-weight: 600; color: var(--text); font-size: .875rem; margin-bottom: .15rem; }
.res-add-banner__sub { color: var(--muted); font-size: .8rem; }

/* Submit modal */
.res-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 600;
  display: flex; align-items: flex-end; justify-content: center;
  animation: resFadeIn .18s ease both;
}
@keyframes resFadeIn { from { opacity:0; } to { opacity:1; } }
@media (min-width: 600px) { .res-modal-overlay { align-items: center; padding: 1.5rem; } }
.res-modal-sheet {
  background: var(--surface); border-radius: 16px 16px 0 0;
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  padding: 1.5rem 1.25rem 2rem; animation: resSlideUp .22s ease both;
}
@keyframes resSlideUp { from { transform:translateY(24px); opacity:0; } to { transform:translateY(0); opacity:1; } }
@media (min-width: 600px) { .res-modal-sheet { border-radius: 16px; } }
.res-modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.res-modal-title { font-size: 1.05rem; font-weight: 700; }
.res-modal-close {
  width: 32px; height: 32px; border-radius: 999px; display: flex; align-items: center;
  justify-content: center; color: var(--muted); font-size: 1.1rem; cursor: pointer;
  background: none; border: none; transition: background .15s;
}
.res-modal-close:hover { background: var(--bg); color: var(--text); }

/* Form elements in modal */
.res-form-group { margin-bottom: 1rem; }
.res-form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
.res-form-label span { color: var(--muted); font-weight: 400; }
.res-form-input, .res-form-select, .res-form-textarea {
  width: 100%; padding: .6rem .85rem; border: 1.5px solid var(--line);
  border-radius: 8px; font-size: .875rem; font-family: inherit;
  color: var(--text); background: var(--surface); transition: border-color .15s; outline: none;
}
.res-form-input:focus, .res-form-select:focus, .res-form-textarea:focus { border-color: var(--primary); }
.res-form-textarea { resize: vertical; min-height: 80px; }
.res-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.25rem;
}
.res-form-hint { font-size: .75rem; color: var(--muted); margin-top: .3rem; }
.res-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 480px) { .res-form-row { grid-template-columns: 1fr; } }
.res-form-year-grid { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.res-form-year-btn {
  padding: .35rem .8rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.res-form-year-btn.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.res-form-submit-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1.25rem; }

/* Cascade steps */
.res-cascade-steps { display: flex; align-items: center; gap: .4rem; margin-bottom: 1rem; font-size: .75rem; color: var(--muted); flex-wrap: wrap; }
.res-cascade-step { padding: .2rem .6rem; border-radius: 999px; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.res-cascade-step.done { background: #eaf2ff; color: var(--primary); border-color: #bfdbfe; }
.res-cascade-step.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.res-cascade-sep { color: var(--line); }