/* =========================================================
   Piano Academy — stil academic & muzical-artistic
   Paleta: bleumarin profund, auriu, fildes, accent bordo
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --navy-deep: #12172e;
  --navy: #1a2142;
  --navy-light: #262f56;
  --gold: #c9a227;
  --gold-light: #e6c65c;
  --cream: #f8f4ea;
  --ivory: #fffdf7;
  --maroon: #7a2e3a;
  --text-dark: #1c1c1c;
  --text-muted: #6b6b76;
  --shadow: 0 10px 30px rgba(18, 23, 46, 0.15);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--text-dark);
  font-family: 'Poppins', sans-serif;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, .brand, .font-serif {
  font-family: 'Playfair Display', serif;
}

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

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Piano key motif (decorative strip) ---------- */
.piano-strip {
  height: 10px;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    #ffffff 0px, #ffffff 26px,
    #12172e 26px, #12172e 30px
  );
  border-bottom: 2px solid var(--gold);
}

/* ---------- Header / Nav ---------- */
.site-header {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: var(--ivory);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1140px;
  margin: 0 auto;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
}

.brand .keys {
  font-size: 1.3rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 0 auto;
  background: var(--ivory);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-links a {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.9;
  transition: opacity 0.2s, color 0.2s;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  opacity: 1;
  color: var(--gold-light);
  border-bottom: 2px solid var(--gold);
}

.badge-role {
  background: var(--gold);
  color: var(--navy-deep);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy-deep);
  box-shadow: 0 6px 16px rgba(201, 162, 39, 0.35);
}
.btn-gold:hover { box-shadow: 0 10px 22px rgba(201, 162, 39, 0.45); }

.btn-navy {
  background: var(--navy);
  color: var(--ivory);
}
.btn-navy:hover { background: var(--navy-light); }

.btn-outline {
  background: transparent;
  border: 2px solid var(--navy);
  color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--ivory); }

.btn-maroon {
  background: var(--maroon);
  color: var(--ivory);
}

.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 6px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(circle at top right, #232c52, var(--navy-deep));
  color: var(--ivory);
  padding: 90px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: -40px; left: 0; right: 0;
  height: 60px;
  background: repeating-linear-gradient(90deg, #fff 0 26px, var(--navy-deep) 26px 30px);
  opacity: 0.08;
}

.hero h1 {
  font-size: 2.8rem;
  line-height: 1.2;
  margin-bottom: 18px;
  max-width: 700px;
}

.hero p {
  font-size: 1.15rem;
  color: #d8dcf0;
  max-width: 560px;
  margin-bottom: 32px;
}

.hero .gold-accent { color: var(--gold-light); }

/* ---------- Cards ---------- */
.card {
  background: var(--ivory);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

.section {
  padding: 70px 0;
}

.section-title {
  text-align: center;
  font-size: 2.1rem;
  margin-bottom: 10px;
  color: var(--navy-deep);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 48px;
}

/* ---------- About / Despre profesor ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: center;
}
.about-photo-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  margin: 0 auto;
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  box-shadow: var(--shadow);
  border: 5px solid var(--gold);
}
.about-text h2 { color: var(--navy-deep); font-size: 2rem; margin-bottom: 14px; }
.about-text p { color: var(--text-muted); line-height: 1.7; margin-bottom: 14px; }
.about-text strong { color: var(--navy-deep); }
.about-stats {
  display: flex;
  gap: 32px;
  margin: 24px 0 22px;
  flex-wrap: wrap;
}
.about-stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
}
.about-stat-label { font-size: 0.8rem; color: var(--text-muted); }

@media (max-width: 700px) {
  .about-grid { grid-template-columns: 1fr; text-align: center; }
  .about-stats { justify-content: center; }
}

/* ---------- Plans / Pricing ---------- */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

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

.plan-card {
  background: var(--ivory);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--navy);
  position: relative;
  transition: transform 0.2s ease;
}
.plan-card:hover { transform: translateY(-6px); }

.plan-card.featured {
  border-top: 6px solid var(--gold);
  transform: scale(1.04);
}
.plan-card.featured:hover { transform: scale(1.04) translateY(-6px); }

.plan-card .ribbon {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--navy-deep);
  padding: 5px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-name { font-size: 1.4rem; margin-bottom: 6px; color: var(--navy-deep); }
.plan-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.plan-price { font-size: 2.6rem; font-weight: 700; color: var(--navy-deep); font-family: 'Playfair Display', serif; }
.plan-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }

.plan-features { list-style: none; padding: 0; margin: 24px 0; text-align: left; }
.plan-features li {
  padding: 9px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.plan-features li::before {
  content: "♪";
  color: var(--gold);
  font-weight: 700;
}

/* ---------- Forms ---------- */
.form-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  background: linear-gradient(180deg, var(--cream), #eee6d3);
}

.form-card {
  background: var(--ivory);
  max-width: 460px;
  width: 100%;
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 5px solid var(--gold);
}

.form-card h2 { text-align: center; color: var(--navy-deep); margin-bottom: 6px; }
.form-card .sub { text-align: center; color: var(--text-muted); margin-bottom: 28px; font-size: 0.9rem; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--navy-deep);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd6c4;
  border-radius: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  background: var(--ivory);
  transition: border 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.form-group .hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

.form-footer-link { text-align: center; margin-top: 18px; font-size: 0.9rem; color: var(--text-muted); }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
}
.alert-error { background: #fbe3e3; color: #8b1f1f; border: 1px solid #f0b3b3; }
.alert-success { background: #e2f3e6; color: #1f6a34; border: 1px solid #b3e0bf; }
.alert-info { background: #e7edfb; color: #223a7a; border: 1px solid #c3d2f5; }

/* ---------- Dashboard ---------- */
.dash-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  padding: 40px 0 80px;
}
@media (max-width: 850px) {
  .dash-layout { grid-template-columns: 1fr; }
}

.sidebar {
  background: var(--navy-deep);
  color: var(--ivory);
  border-radius: var(--radius);
  padding: 26px;
  height: fit-content;
}
.sidebar h3 { color: var(--gold-light); font-size: 1.05rem; margin-bottom: 4px; }
.sidebar p { color: #b9c0dd; font-size: 0.85rem; margin-bottom: 20px; }
.sidebar .sub-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-deep);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li {
  padding: 12px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lesson-list li.active { background: rgba(201,162,39,0.18); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.trimisa { background: #f0b429; }
.status-dot.tema_trimisa { background: #4a90d9; }
.status-dot.notata { background: #3fbf60; }

.lesson-content h2 { color: var(--navy-deep); margin-bottom: 6px; }
.lesson-meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }

.video-frame {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.video-frame video { width: 100%; display: block; max-height: 480px; }

.grade-box {
  background: var(--cream);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  padding: 20px 24px;
  margin-top: 20px;
}
.grade-box .grade-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--navy-deep);
  font-weight: 700;
}

/* ---------- Tables (admin) ---------- */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--ivory);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table.data-table th {
  background: var(--navy-deep);
  color: var(--gold-light);
  text-align: left;
  padding: 14px 16px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
table.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #eee;
  font-size: 0.92rem;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #faf7ef; }

.tag {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-active { background: #e2f3e6; color: #1f6a34; }
.tag-expired { background: #fbe3e3; color: #8b1f1f; }
.tag-none { background: #eee; color: #777; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: #9aa2c4;
  text-align: center;
  padding: 30px 0;
  font-size: 0.85rem;
}
.site-footer .gold-accent { color: var(--gold); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* =========================================================
   Social media / Comunitate
   ========================================================= */

.social-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 30px;
  border-bottom: 2px solid #e8e0cc;
  flex-wrap: wrap;
}
.social-tabs a {
  padding: 12px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.social-tabs a.active {
  color: var(--navy-deep);
  border-bottom: 3px solid var(--gold);
}
.count-badge {
  background: var(--maroon);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-deep));
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.avatar.sm { width: 34px; height: 34px; font-size: 0.85rem; }
.avatar.lg { width: 74px; height: 74px; font-size: 1.6rem; }

.composer {
  background: var(--ivory);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 30px;
  border-top: 4px solid var(--gold);
}
.composer textarea {
  width: 100%;
  border: 1.5px solid #ddd6c4;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 70px;
}
.composer textarea:focus { outline: none; border-color: var(--gold); }
.composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 12px;
}

.attach-buttons { display: flex; gap: 10px; }

.attach-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 20px;
  border: 1.5px solid #ddd6c4;
  background: var(--cream);
  color: var(--navy-deep);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.attach-btn:hover { border-color: var(--gold); background: #f3ecd8; }
.attach-btn.has-file { border-color: var(--gold); background: rgba(201,162,39,0.15); color: var(--maroon); }
.attach-btn .attach-icon { font-size: 1rem; line-height: 1; }
.attach-btn input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Varianta "block": buton singular de upload, pe toata latimea, pentru formulare
   unde e singurul camp de fisier (lectie video, tema, avatar, portofoliu). */
.attach-btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1.5px dashed #ddd6c4;
  font-size: 0.95rem;
}
.attach-btn-block .attach-icon { font-size: 1.2rem; }
.attach-btn-block:hover { border-color: var(--gold); }
.attach-btn-block.has-file { border-style: solid; }

.attach-preview { margin-top: 10px; }
.attach-preview:empty { margin-top: 0; }
.attach-preview-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 1.5px solid #ddd6c4;
  border-radius: 10px;
  padding: 6px 8px;
  max-width: 100%;
}
.attach-preview-item img.thumb {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.attach-preview-item .file-label {
  font-size: 0.82rem;
  color: var(--navy-deep);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attach-preview-item .remove-attach {
  background: none;
  border: none;
  color: var(--maroon);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  flex-shrink: 0;
}
.attach-preview-item .remove-attach:hover { color: #5a1520; }

.post-video {
  width: 100%;
  max-height: 480px;
  display: block;
  background: #000;
}

.post-card {
  background: var(--ivory);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 26px;
  overflow: hidden;
}
.post-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 10px;
}
.post-head .who { flex: 1; }
.post-head .who a { font-weight: 700; color: var(--navy-deep); font-size: 0.98rem; }
.post-head .who .when { font-size: 0.78rem; color: var(--text-muted); }
.post-body { padding: 0 20px 16px; font-size: 0.95rem; line-height: 1.5; white-space: pre-line; }
.post-image { width: 100%; max-height: 480px; object-fit: cover; display: block; background: #eee; }
.post-actions {
  display: flex;
  gap: 18px;
  padding: 10px 20px;
  border-top: 1px solid #f0ead9;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.post-actions form { display: inline; }
.post-actions button.link-btn, .link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--text-muted); font-size: 0.85rem; font-family: 'Poppins', sans-serif;
}
.post-actions button.link-btn:hover, .link-btn:hover { color: var(--maroon); }

.comments-block { background: #fbf9f2; padding: 14px 20px 18px; }
.comment-row { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
.comment-bubble {
  background: #fff;
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 0.88rem;
  flex: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.comment-bubble strong { color: var(--navy-deep); display: block; font-size: 0.82rem; margin-bottom: 2px; }
.comment-form { display: flex; gap: 10px; margin-top: 10px; }
.comment-form input {
  flex: 1;
  border: 1.5px solid #ddd6c4;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-family: 'Poppins', sans-serif;
}
.comment-form input:focus { outline: none; border-color: var(--gold); }
.comment-form button {
  border: none;
  background: var(--navy-deep);
  color: var(--gold-light);
  padding: 8px 18px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.member-card {
  background: var(--ivory);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  text-align: center;
}
.member-card .avatar { margin: 0 auto 12px; }
.member-card h4 { margin: 0 0 4px; color: var(--navy-deep); }
.member-card p { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 14px; }

.friend-request-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ivory);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 14px;
}
.friend-request-card .who { flex: 1; }
.friend-request-card .who a { font-weight: 700; color: var(--navy-deep); }

/* ---------- Portofoliu (vitrina publica de rezultate) ---------- */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}
.portfolio-card {
  background: var(--ivory);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 4px solid var(--gold);
  transition: transform 0.2s ease;
}
.portfolio-card:hover { transform: translateY(-4px); }
.portfolio-video {
  width: 100%;
  max-height: 320px;
  display: block;
  background: #000;
}
.portfolio-body { padding: 18px 20px 22px; }
.portfolio-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.portfolio-name-row h3 { margin: 0; color: var(--navy-deep); font-size: 1.15rem; }
.portfolio-desc { color: var(--text-muted); font-size: 0.9rem; margin: 10px 0 0; line-height: 1.5; }

/* ---------- Tables: horizontal scroll wrapper for small screens ---------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.table-responsive table.data-table { box-shadow: none; border-radius: 0; }

/* =========================================================
   Responsive breakpoints
   ========================================================= */

/* ---- Tablets and small laptops ---- */
@media (max-width: 1024px) {
  .hero h1 { font-size: 2.3rem; }
  .container { padding: 0 20px; }
}

/* ---- Mobile navigation ---- */
@media (max-width: 780px) {
  .nav-wrap { padding: 14px 20px; position: relative; }
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--navy-deep);
    box-shadow: var(--shadow);
    padding: 8px 20px 18px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links li a,
  .nav-links li .btn {
    display: block;
    width: 100%;
    padding: 12px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav-links li .btn {
    margin-top: 6px;
    border-bottom: none;
    padding: 12px 28px;
    text-align: center;
  }
  .badge-role { display: inline-block; margin: 8px 0; }
}

/* ---- General mobile layout ---- */
@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .hero { padding: 60px 0 70px; }
  .hero h1 { font-size: 1.85rem; }
  .hero p { font-size: 1rem; }
  .hero .btn { display: block; width: 100%; }
  .hero .btn + .btn { margin-left: 0 !important; margin-top: 12px; }

  .section { padding: 44px 0; }
  .section-title { font-size: 1.6rem; }
  .section-subtitle { padding: 0 6px; }

  .card { padding: 22px; }

  .plan-card.featured { transform: none; }
  .plan-card.featured:hover { transform: translateY(-6px); }

  .form-card { padding: 28px 22px; }
  .form-row { flex-direction: column; gap: 0; }

  .dash-layout { padding: 24px 0 56px; gap: 20px; }
  .sidebar { padding: 20px; }

  table.data-table th,
  table.data-table td { padding: 10px 12px; font-size: 0.85rem; white-space: nowrap; }

  .composer-footer { flex-wrap: wrap; gap: 10px; }
  .composer-footer input[type="file"] { max-width: 100%; }

  .post-head { flex-wrap: wrap; }
  .comment-form { flex-wrap: wrap; }
  .comment-form button { width: 100%; }

  .social-tabs { gap: 2px; }
  .social-tabs a { padding: 10px 12px; font-size: 0.85rem; }

  .grade-box .grade-number { font-size: 1.8rem; }
}

/* ---- Small phones ---- */
@media (max-width: 400px) {
  .brand { font-size: 1.2rem; }
  .hero h1 { font-size: 1.55rem; }
  .plan-price { font-size: 2.1rem; }
  .btn:not(.btn-sm) { padding: 11px 20px; font-size: 0.9rem; }
}

