/* ========================================
   Estudio de Arte Julia Bermúdez
   App Panel Styles (Internal Platform)
   ======================================== */

/* ============ APP LAYOUT ============ */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
}

.sidebar {
  width: 260px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color-strong);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease, width 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.app-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.app-content {
  padding: 2rem;
  flex: 1;
}

/* ============ SIDEBAR ============ */
.sidebar-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color-strong);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.sidebar-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
}

.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  box-shadow: 0 3px 10px rgba(139, 94, 60, 0.25);
}

.sidebar-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-logo-text span {
  color: var(--accent-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-section {
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-tertiary);
  padding: 0.6rem 0.75rem 0.3rem;
  margin-top: 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(176, 112, 16, 0.12);
  color: var(--accent-primary);
  font-weight: 600;
}

[data-theme="dark"] .sidebar-link.active {
  background: rgba(200, 152, 40, 0.15);
}

.sidebar-link .link-icon {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
}

.sidebar-link .link-badge {
  margin-left: auto;
  background: var(--accent-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color-strong);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
}

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

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.sidebar-logout {
  background: none;
  border: none;
  padding: 0.4rem;
  border-radius: 8px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.sidebar-logout:hover {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

/* ============ TOPBAR ============ */
.app-topbar {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 0 var(--border-color);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-secondary);
}

.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-subtitle {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: 0.1rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  width: 250px;
  transition: all 0.3s ease;
}

.topbar-search:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.1);
}

.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 100%;
  font-family: 'Inter', sans-serif;
}

.topbar-search input::placeholder {
  color: var(--text-tertiary);
}

.topbar-search .search-icon {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.topbar-btn .notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: #E05252;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* ============ STAT CARDS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-color);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.stat-icon.blue { background: rgba(88, 136, 210, 0.12); }
.stat-icon.green { background: rgba(90, 143, 90, 0.12); }
.stat-icon.orange { background: rgba(196, 149, 106, 0.15); }
.stat-icon.purple { background: rgba(107, 76, 122, 0.12); }

.stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.stat-change.positive {
  background: rgba(90, 143, 90, 0.1);
  color: #5A8F5A;
}

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 0.3rem;
}

/* ============ CONTENT CARDS ============ */
.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.content-card-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.content-card-body {
  padding: 1.5rem;
}

.content-card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

/* ============ LESSON CARDS ============ */
.lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.lesson-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--shadow-color-strong);
  border-color: var(--accent-warm);
  color: inherit;
}

.lesson-thumbnail {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.lesson-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.lesson-card:hover .lesson-thumbnail img {
  transform: scale(1.05);
}

.lesson-thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lesson-card:hover .lesson-thumbnail-overlay {
  opacity: 1;
}

.lesson-play-btn {
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.lesson-badge-top {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gradient-accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lesson-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.lesson-info {
  padding: 1.2rem;
}

.lesson-category-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.lesson-info h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

.lesson-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.lesson-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.lesson-completed-check {
  color: var(--success);
  font-weight: 700;
}

/* ============ LESSON DETAIL ============ */
.lesson-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
}

.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-color-strong);
}

.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lesson-detail-content {
  margin-top: 1.5rem;
}

.lesson-detail-content h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.lesson-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.materials-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.material-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.material-item .material-icon {
  font-size: 1rem;
}

.exercise-box {
  background: rgba(139, 94, 60, 0.06);
  border: 1px solid var(--accent-warm);
  border-radius: 14px;
  padding: 1.5rem;
}

[data-theme="dark"] .exercise-box {
  background: rgba(196, 149, 106, 0.08);
}

.exercise-box h3 {
  font-size: 1rem;
  color: var(--accent-primary);
  margin-bottom: 0.8rem;
}

.exercise-box p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============ SUBMISSIONS ============ */
.submissions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.submission-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.submission-card:hover {
  box-shadow: 0 4px 16px var(--shadow-color);
}

.submission-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
}

.submission-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.submission-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  padding: 0.5rem;
}

.submission-images img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.submission-images img:hover {
  transform: scale(1.02);
}

.submission-text {
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.submission-feedback {
  margin: 0 1.2rem 1.2rem;
  padding: 1.2rem;
  background: rgba(90, 143, 90, 0.06);
  border: 1px solid rgba(90, 143, 90, 0.2);
  border-radius: 12px;
}

[data-theme="dark"] .submission-feedback {
  background: rgba(90, 143, 90, 0.08);
}

.submission-feedback h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.submission-feedback p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============ UPLOAD / DROPZONE ============ */
.dropzone {
  border: 2px dashed var(--border-color-strong);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--bg-secondary);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(139, 94, 60, 0.04);
}

[data-theme="dark"] .dropzone:hover,
[data-theme="dark"] .dropzone.dragover {
  background: rgba(196, 149, 106, 0.06);
}

.dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.8rem;
}

.dropzone-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.upload-preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
}

.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============ COMMUNITY FEED ============ */
.community-feed {
  max-width: 650px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
}

.post-header-info {
  flex: 1;
}

.post-author-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.post-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.post-body {
  padding: 0 1.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.8rem;
}

.post-images {
  display: grid;
  gap: 2px;
}

.post-images.single img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.post-images.multiple {
  grid-template-columns: 1fr 1fr;
}

.post-images img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.post-images img:hover {
  opacity: 0.92;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--border-color);
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-action-btn:hover {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

.post-action-btn.liked {
  color: #E05252;
}

.post-comments-section {
  border-top: 1px solid var(--border-color);
  padding: 1rem 1.2rem;
}

.comment-item {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.comment-bubble {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  flex: 1;
}

.comment-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.comment-time {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.3rem;
}

.comment-input-wrapper {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.comment-input-wrapper input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  font-family: 'Inter', sans-serif;
}

.comment-input-wrapper input:focus {
  border-color: var(--accent-primary);
}

.comment-send-btn {
  padding: 0.5rem 1rem;
  background: var(--gradient-accent);
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* Post Composer */
.post-composer {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.post-composer-top {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.post-composer textarea {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  resize: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  min-height: 60px;
}

.post-composer textarea::placeholder {
  color: var(--text-tertiary);
}

.post-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-color);
}

.post-composer-tools {
  display: flex;
  gap: 0.3rem;
}

.composer-tool-btn {
  padding: 0.4rem;
  border-radius: 8px;
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all 0.2s ease;
}

.composer-tool-btn:hover {
  background: var(--bg-secondary);
  color: var(--accent-primary);
}

.post-submit-btn {
  padding: 0.5rem 1.2rem;
  background: var(--gradient-accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.post-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 94, 60, 0.3);
}

/* ============ DATA TABLES (Admin) ============ */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
}

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

.data-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background 0.2s ease;
}

.data-table tbody tr:hover {
  background: var(--bg-secondary);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.table-user-name {
  font-weight: 600;
  color: var(--text-primary);
}

.table-user-email {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.table-actions {
  display: flex;
  gap: 0.3rem;
}

.table-action-btn {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.table-action-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.table-action-btn.danger:hover {
  border-color: #E05252;
  color: #E05252;
  background: rgba(224, 82, 82, 0.06);
}

/* Table Toolbar */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.table-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.filter-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pending {
  background: rgba(232, 168, 56, 0.12);
  color: #C4880A;
}

.badge-reviewed {
  background: rgba(90, 143, 90, 0.12);
  color: #5A8F5A;
}

.badge-active {
  background: rgba(90, 143, 90, 0.12);
  color: #5A8F5A;
}

.badge-inactive {
  background: rgba(120, 120, 120, 0.12);
  color: #888;
}

.badge-admin {
  background: rgba(107, 76, 122, 0.12);
  color: var(--accent-tertiary);
}

.badge-presential {
  background: rgba(88, 136, 210, 0.12);
  color: #5888D2;
}

.badge-new {
  background: rgba(196, 149, 106, 0.15);
  color: var(--accent-primary);
}

.badge-invited {
  background: rgba(90, 143, 90, 0.12);
  color: #5A8F5A;
}

.badge-waiting {
  background: rgba(120, 120, 120, 0.12);
  color: #888;
}

/* ============ ORDER BUTTONS (waitlist) ============ */
.order-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.65rem;
  padding: 1px 5px;
  color: var(--text-tertiary);
  line-height: 1.2;
  transition: background 0.15s, color 0.15s;
}
.order-btn:hover:not(:disabled) {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.order-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* ============ PROGRESS BAR ============ */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.3rem;
}

/* ============ AVATARS ============ */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
  flex-shrink: 0;
}

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

.avatar-sm { width: 32px; height: 32px; font-size: 0.7rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.6rem; }

/* ============ TABS ============ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.7rem 1.2rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--accent-primary);
  font-weight: 600;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: 1px;
}

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
  display: none;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeInUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.2rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

.modal-wide {
  max-width: 700px;
}

/* ============ TOASTS ============ */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 280px;
  max-width: 400px;
  box-shadow: 0 8px 30px var(--shadow-color-strong);
  animation: slideInRight 0.3s ease;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.toast-success { border-left: 4px solid #5A8F5A; }
.toast-error { border-left: 4px solid #E05252; }
.toast-info { border-left: 4px solid #5888D2; }

.toast-icon { font-size: 1.1rem; }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 0.2rem;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============ EMPTY STATES ============ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ============ LOADING ============ */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-tertiary) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

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

.skeleton-text { height: 14px; margin-bottom: 0.5rem; }
.skeleton-title { height: 22px; width: 60%; margin-bottom: 0.8rem; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 200px; border-radius: 16px; }

/* ============ BUTTONS (App-specific) ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary-app {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 3px 12px rgba(139, 94, 60, 0.25);
}

.btn-primary-app:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(139, 94, 60, 0.35);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0.8rem;
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-danger {
  background: rgba(224, 82, 82, 0.1);
  color: #E05252;
  border: 1px solid rgba(224, 82, 82, 0.2);
}

.btn-danger:hover {
  background: rgba(224, 82, 82, 0.15);
}

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 0.9rem 1.8rem; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ============ FORMS (App-specific) ============ */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.1);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B5B4E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

.form-help {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.3rem;
}

.form-error {
  font-size: 0.75rem;
  color: #E05252;
  margin-top: 0.3rem;
}

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

/* ============ ACTIVITY FEED ============ */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  margin-top: 6px;
}

.activity-dot.green { background: #5A8F5A; }
.activity-dot.orange { background: #E8A838; }
.activity-dot.blue { background: #5888D2; }
.activity-dot.purple { background: var(--accent-tertiary); }

.activity-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.activity-time {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.2rem;
}

/* ============ PROFILE PAGE ============ */
.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  margin-bottom: 2rem;
}

.profile-avatar-upload {
  position: relative;
  cursor: pointer;
}

.profile-avatar-upload .avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  color: white;
  font-size: 1.2rem;
}

.profile-avatar-upload:hover .avatar-overlay {
  opacity: 1;
}

.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 600;
}

.profile-email {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.profile-stats {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
}

.profile-stat {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.profile-stat strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============ AUTH PAGES ============ */
.auth-layout {
  display: flex;
  min-height: 100vh;
}

.auth-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-right {
  flex: 1;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.auth-right::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(196, 149, 106, 0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-right::after {
  content: '';
  position: absolute;
  bottom: -10%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(107, 76, 122, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-decoration: none;
}

.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.auth-form .form-group {
  margin-bottom: 1.2rem;
}

.auth-form .form-input {
  padding: 0.85rem 1rem;
}

.auth-form .btn-primary-app {
  width: 100%;
  justify-content: center;
  padding: 0.9rem;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* ---- Password Toggle ---- */
.input-password-wrapper {
  position: relative;
}

.input-password-wrapper .form-input {
  padding-right: 2.8rem;
}

.input-password-toggle {
  position: absolute;
  right: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  transition: color 0.2s ease;
  line-height: 0;
}

.input-password-toggle:hover {
  color: var(--accent-primary);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--accent-primary);
  font-weight: 600;
}

.auth-promo {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 400px;
}

.auth-promo-quote {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.auth-promo-author {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-promo-features {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-align: left;
}

.auth-promo-feature {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-promo-feature .feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(139, 94, 60, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* ============ MOBILE BOTTOM NAV ============ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  z-index: 100;
  padding: 0.4rem 0;
  padding-bottom: env(safe-area-inset-bottom, 0.4rem);
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  list-style: none;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-tertiary);
  font-size: 0.65rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.bottom-nav-item .nav-item-icon {
  font-size: 1.2rem;
}

.bottom-nav-item.active {
  color: var(--accent-primary);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .lesson-detail-layout {
    grid-template-columns: 1fr;
  }

  .topbar-search {
    width: 200px;
  }

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 8px 0 30px rgba(0,0,0,0.1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0;
  }

  .app-content {
    padding: 1.2rem;
    padding-bottom: 5rem;
  }

  .topbar-menu-btn {
    display: flex;
  }

  .topbar-search {
    display: none;
  }

  .bottom-nav {
    display: block;
  }

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

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

  .auth-layout {
    flex-direction: column;
  }

  .auth-right {
    display: none;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-stats {
    justify-content: center;
  }

  .app-topbar {
    padding: 1rem 1.2rem;
  }

  .modal {
    border-radius: 16px 16px 0 0;
    position: absolute;
    bottom: 0;
    max-height: 85vh;
  }

  .submission-images {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============ SIDEBAR OVERLAY (mobile) ============ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 99;
}

.sidebar-overlay.show {
  display: block;
}

/* ============ MISC ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hidden { display: none; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
