/* =====================================================
   MEXGRAM - Hoja de estilos principal
   Dark theme · Glassmorphism · Colores mexicanos
   ===================================================== */

/* ===== VARIABLES ===== */
:root {
  --verde:       #006847;
  --verde-light: #00a86b;
  --verde-neon:  #00ff9d;
  --rojo:        #ce1126;
  --rojo-light:  #ff3347;
  --oro:         #d4af37;
  --oro-light:   #f5d060;

  --bg-base:     #0a0a0a;
  --bg-card:     #111111;
  --bg-elevated: #1a1a1a;
  --bg-input:    #1e1e1e;

  --glass:       rgba(255,255,255,0.04);
  --glass-hover: rgba(255,255,255,0.08);
  --glass-border:rgba(255,255,255,0.08);

  --text-primary:   #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted:     #606060;

  --sidebar-w:  240px;
  --header-h:   60px;
  --bottom-nav-h: 64px;

  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:  0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.6);
  --shadow-neon-green: 0 0 20px rgba(0,255,157,0.3);
  --shadow-neon-red:   0 0 20px rgba(206,17,38,0.3);

  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow:   0.4s ease;
  --transition-spring: 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

/* ===== RESET ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
input, textarea, select {
  font-family: inherit;
  outline: none;
  border: none;
  background: none;
}
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 4px; }

/* ===== PAGE LOADER ===== */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-content { text-align: center; }
.loader-logo {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -2px;
  margin-bottom: 24px;
  animation: pulse-logo 1.5s ease infinite;
}
.logo-mx   { color: var(--verde-neon); }
.logo-gram { color: var(--text-primary); }
.loader-bar {
  width: 200px;
  height: 3px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.loader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--verde), var(--verde-neon), var(--rojo));
  border-radius: var(--radius-full);
  animation: loader-fill 1.5s ease forwards;
}
@keyframes loader-fill {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes pulse-logo {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100dvh;
}
.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding-bottom: 0;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: 100dvh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  height: 100dvh;
  z-index: 100;
  border-right: 1px solid var(--glass-border);
  background: rgba(10,10,10,0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
}
.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 20px 12px;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 12px 12px 24px;
  margin-bottom: 8px;
}
.logo-text {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -1px;
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.sidebar-nav li { position: relative; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  position: relative;
}
.nav-link:hover,
.sidebar-nav li.active .nav-link {
  color: var(--text-primary);
  background: var(--glass-hover);
}
.sidebar-nav li.active .nav-link { color: var(--verde-neon); }
.nav-link i {
  width: 22px;
  text-align: center;
  font-size: 1.1rem;
  transition: transform var(--transition-spring);
}
.nav-link:hover i { transform: scale(1.15); }
.nav-upload-btn {
  color: var(--verde-light) !important;
  border: 1px solid rgba(0,168,107,0.3);
  margin-top: 8px;
}
.nav-upload-btn:hover {
  background: rgba(0,168,107,0.1) !important;
  border-color: var(--verde-light);
}
.nav-admin {
  color: var(--oro-light) !important;
}
.notif-badge {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--rojo);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  border-top: 1px solid var(--glass-border);
  margin-top: 12px;
}
.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  padding: 6px 8px;
  transition: background var(--transition-fast);
}
.sidebar-user-link:hover { background: var(--glass-hover); }
.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-username {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-logout {
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.sidebar-logout:hover { color: var(--rojo-light); background: rgba(206,17,38,0.1); }

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,10,10,0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}
.mobile-logo {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -1px;
}
.mobile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: background var(--transition-fast);
  position: relative;
}
.mobile-icon-btn:hover { background: var(--glass-hover); }
.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--rojo);
  border-radius: 50%;
  border: 2px solid var(--bg-base);
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--bottom-nav-h);
  background: rgba(10,10,10,0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(210,210,210,.88);
  font-size: 1.3rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}
.bottom-nav-item.active { color: var(--verde-neon); }
.bottom-nav-item:hover { color: var(--text-primary); }
.bottom-create {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--verde), var(--verde-light));
  color: white !important;
  border-radius: 14px;
  font-size: 1.2rem;
  box-shadow: 0 4px 16px rgba(0,104,71,0.4);
}
.bottom-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== GLASS COMPONENTS ===== */
.glass-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}
.glass-panel {
  background: rgba(15,15,15,0.98);
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--verde), var(--verde-light));
  color: white;
  box-shadow: 0 4px 16px rgba(0,104,71,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,104,71,0.5);
}
.btn-secondary {
  background: var(--glass-hover);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}
.btn-danger {
  background: linear-gradient(135deg, var(--rojo), var(--rojo-light));
  color: white;
}
.btn-danger:hover { transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text-primary); background: var(--glass); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== INPUTS ===== */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.input-field {
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  width: 100%;
  transition: all var(--transition-fast);
}
.input-field:focus {
  border-color: var(--verde-light);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(0,168,107,0.15);
}
.input-field::placeholder { color: var(--text-muted); }
.input-field.error { border-color: var(--rojo); }
.input-icon-wrap {
  position: relative;
}
.input-icon-wrap .input-field { padding-left: 44px; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}
.input-error { font-size: 0.8rem; color: var(--rojo-light); margin-top: 4px; }

/* ===== AVATAR RING ===== */
.avatar-ring {
  position: relative;
  display: inline-block;
  border-radius: 50%;
}
.avatar-ring.has-story::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rojo), var(--oro), var(--verde));
  z-index: -1;
}
.avatar-ring.has-story img {
  border: 2px solid var(--bg-base);
}

/* ===== STORIES BAR ===== */
.stories-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }
.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-spring);
}
.story-item:hover { transform: scale(1.05); }
.story-avatar-wrap {
  position: relative;
  width: 66px;
  height: 66px;
}
.story-avatar-ring {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, var(--rojo), var(--oro), var(--verde));
}
.story-avatar-ring.viewed {
  background: var(--bg-elevated);
}
.story-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-base);
}
.story-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  max-width: 70px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.story-add-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--glass);
  border: 2px dashed var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--verde-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.story-add-btn:hover { background: rgba(0,168,107,0.1); border-color: var(--verde-light); }

/* ===== POSTS / FEED ===== */
.feed-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 80px;
}
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.post-card:hover { box-shadow: var(--shadow-md); }
.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.post-user-info { flex: 1; min-width: 0; }
.post-username {
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.post-username a:hover { color: var(--verde-light); }
.verified-badge { color: var(--verde-light); font-size: 0.75rem; }
.post-location {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.post-more-btn {
  color: var(--text-muted);
  padding: 6px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}
.post-more-btn:hover { background: var(--glass-hover); color: var(--text-primary); }
/* Text / thread post card */
.post-text-card {
  width: 100%;
  position: relative;
  min-height: 200px;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 24px;
  overflow: hidden;
}
.post-text-content {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.7;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0,0,0,.25);
  word-break: break-word;
}
.post-text-content .hashtag {
  color: rgba(255,255,255,.85);
  text-decoration: underline; text-decoration-color: rgba(255,255,255,.4);
  cursor: pointer;
}
.post-media {
  width: 100%;
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  overflow: hidden;
}
.post-media img, .post-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-media-carousel { position: relative; }
.carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.5);
  transition: all var(--transition-fast);
}
.carousel-dot.active {
  width: 18px;
  background: white;
}
.post-actions {
  display: flex;
  align-items: center;
  padding: 10px 14px 6px;
  gap: 4px;
}
.post-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.post-action-btn:hover { color: var(--text-primary); background: var(--glass); }
.post-action-btn.liked { color: var(--rojo-light); }
.post-action-btn.saved { color: var(--oro-light); }
.post-action-btn i { font-size: 1.15rem; }
.action-count { font-size: 0.8rem; font-weight: 600; }
.post-save-btn { margin-left: auto; }
.post-likes-text {
  padding: 2px 14px 8px;
  font-size: 0.85rem;
  font-weight: 700;
}
.post-caption {
  padding: 0 14px 8px;
  font-size: 0.9rem;
  line-height: 1.6;
}
.post-caption strong { font-weight: 700; }
.post-caption .hashtag { color: var(--verde-light); cursor: pointer; }
.post-time {
  padding: 0 14px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.post-comments-preview {
  padding: 0 14px 8px;
}
.comment-preview {
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.comment-preview strong { font-weight: 700; cursor: pointer; }
.comment-preview strong:hover { color: var(--verde-light); }
.view-comments-btn {
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
}
.view-comments-btn:hover { color: var(--text-secondary); }
.post-comment-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--glass-border);
}
.post-comment-input .comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-text-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 8px 14px;
  color: var(--text-primary);
  font-size: 0.85rem;
  transition: border-color var(--transition-fast);
}
.comment-text-input:focus { border-color: var(--glass-border); }
.comment-text-input::placeholder { color: var(--text-muted); }
.comment-submit-btn {
  color: var(--verde-light);
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--transition-fast);
  padding: 4px 8px;
}
.comment-text-input:not(:placeholder-shown) ~ .comment-submit-btn { opacity: 1; }

/* ===== PROFILE ===== */
.profile-page { max-width: 935px; margin: 0 auto; padding: 24px 16px 80px; }
.profile-header {
  display: grid;
  grid-template-columns: 150px 1fr;
  grid-template-rows: auto auto;
  column-gap: 40px;
  row-gap: 20px;
  margin-bottom: 32px;
  align-items: start;
}
.profile-avatar-wrap {
  grid-column: 1;
  grid-row: 1 / 3;
  flex-shrink: 0;
  position: relative;
}
.profile-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--glass-border);
}
.avatar-edit-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  background: var(--bg-elevated);
  border: 2px solid var(--bg-base);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: .78rem;
  text-decoration: none;
  transition: background var(--transition-fast);
}
.avatar-edit-btn:hover { background: var(--bg-card); }
.profile-info { grid-column: 2; grid-row: 1; }
.profile-bio-section { grid-column: 2; grid-row: 2; }
.profile-edit-mobile { display: none; }
.profile-msg-desktop { display: inline-flex; }
.profile-top-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.profile-username-h {
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-stats {
  display: flex;
  gap: 32px;
  margin-bottom: 16px;
}
.profile-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.stat-number {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.profile-bio {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 420px;
}
.profile-bio strong { color: var(--text-primary); font-weight: 700; }
.profile-website { font-size: 0.85rem; color: var(--verde-light); margin-top: 6px; }
.profile-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.profile-tabs {
  display: flex;
  border-top: 1px solid var(--glass-border);
  margin-bottom: 4px;
}
.profile-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-top: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.profile-tab.active {
  color: var(--text-primary);
  border-top-color: var(--text-primary);
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.profile-grid-item {
  aspect-ratio: 1;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.profile-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.profile-grid-item:hover img { transform: scale(1.05); }
.profile-grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.profile-grid-item:hover .profile-grid-overlay { opacity: 1; }
@media (hover: none) {
  .profile-grid-overlay {
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 55%);
    opacity: 1;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 6px 8px;
    gap: 10px;
  }
  .profile-grid-stat { font-size: .72rem; }
}
.profile-grid-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
}

/* ===== EXPLORE ===== */
.explore-page { max-width: 935px; margin: 0 auto; padding: 16px 16px 80px; }
.search-bar-wrap {
  position: relative;
  margin-bottom: 20px;
}
.search-bar {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 12px 16px 12px 44px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}
.search-bar:focus {
  border-color: var(--verde-light);
  background: var(--bg-elevated);
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.trending-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.tag-chip {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.tag-chip:hover { background: var(--glass-hover); color: var(--verde-light); border-color: var(--verde-light); }
/* .explore-grid-item rules removed — explore now uses .collage-grid / .collage-item */

/* ===== REELS ===== */
.reels-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
  background: black;
}
.reels-container {
  height: 100%;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.reels-container::-webkit-scrollbar { display: none; }
.reel-item {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  position: relative;
  scroll-snap-align: start;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.1) 40%,
    rgba(0,0,0,0) 60%
  );
}
.reel-info {
  position: absolute;
  bottom: 80px;
  left: 16px;
  right: 80px;
  z-index: 10;
}
.reel-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.reel-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}
.reel-username { font-weight: 700; font-size: 0.95rem; }
.reel-follow-btn {
  background: transparent;
  border: 1px solid white;
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.reel-follow-btn:hover { background: white; color: black; }
.reel-caption { font-size: 0.9rem; line-height: 1.5; color: rgba(255,255,255,0.95); }
.reel-actions {
  position: absolute;
  right: 14px;
  bottom: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 10;
}
.reel-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: white;
  cursor: pointer;
  transition: transform var(--transition-spring);
}
.reel-action:hover { transform: scale(1.15); }
.reel-action i { font-size: 1.6rem; }
.reel-action span { font-size: 0.75rem; font-weight: 700; }
.reel-action.liked i { color: var(--rojo-light); }
.reel-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255,255,255,0.2);
  z-index: 10;
}
.reel-progress-fill {
  height: 100%;
  background: white;
  width: 0%;
  transition: width 0.1s linear;
}
.reel-mute-btn {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  cursor: pointer;
}

/* ===== STORIES VIEWER ===== */
.story-viewer-overlay {
  position: fixed;
  inset: 0;
  background: black;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.story-viewer-container {
  width: 100%;
  max-width: 390px;
  height: 100vh;
  height: 100dvh;
  position: relative;
}
.story-progress-bars {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 10;
}
.story-progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  overflow: hidden;
}
.story-progress-fill {
  height: 100%;
  background: white;
  width: 0%;
  transition: width linear;
}
.story-progress-fill.complete { width: 100%; }
.story-viewer-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-viewer-header {
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}
.story-viewer-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}
.story-viewer-info { flex: 1; }
.story-viewer-name { font-weight: 700; font-size: 0.9rem; color: white; }
.story-viewer-time { font-size: 0.75rem; color: rgba(255,255,255,0.7); }
.story-close-btn {
  color: white;
  font-size: 1.2rem;
  padding: 8px;
}
.story-nav-left, .story-nav-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  z-index: 5;
  cursor: pointer;
}
.story-nav-left  { left: 0; }
.story-nav-right { right: 0; }
.story-gradient-top {
  position:absolute;top:0;left:0;right:0;height:140px;z-index:4;pointer-events:none;
  background:linear-gradient(to bottom,rgba(0,0,0,.65) 0%,transparent 100%);
}
.story-gradient-bottom {
  position:absolute;bottom:0;left:0;right:0;height:200px;z-index:4;pointer-events:none;
  background:linear-gradient(to top,rgba(0,0,0,.8) 0%,transparent 100%);
}
.story-caption {
  position:absolute;bottom:110px;left:0;right:0;z-index:8;
  text-align:center;color:#fff;font-size:.95rem;font-weight:600;
  text-shadow:0 2px 8px rgba(0,0,0,.8);padding:0 24px;line-height:1.5;
}
.story-bottom-bar {
  position:absolute;bottom:0;left:0;right:0;z-index:10;
  padding:10px 14px max(18px,env(safe-area-inset-bottom));
  display:flex;flex-direction:column;gap:8px;
}
.story-own-bar { align-items:center; }
.story-views-count {
  color:rgba(255,255,255,.75);font-size:.82rem;display:flex;align-items:center;gap:6px;
}
.story-reactions {
  display:flex;gap:8px;justify-content:center;
}
.story-react-btn {
  font-size:1.55rem;background:rgba(255,255,255,.12);-webkit-backdrop-filter:blur(8px);
  font-size:1.55rem;background:rgba(255,255,255,.12);backdrop-filter:blur(8px);
  border:1.5px solid rgba(255,255,255,.2);border-radius:50%;
  width:46px;height:46px;display:flex;align-items:center;justify-content:center;
  cursor:pointer;transition:transform .15s,background .15s;flex-shrink:0;
}
.story-react-btn:active,.story-react-btn.reacted { transform:scale(1.25);background:rgba(255,255,255,.28); }
.story-react-popup {
  position:fixed;font-size:2.5rem;animation:storyReactPop .8s forwards;
  pointer-events:none;z-index:999;
}
@keyframes storyReactPop {
  0%{transform:translateY(0) scale(1);opacity:1}
  100%{transform:translateY(-80px) scale(1.5);opacity:0}
}
.story-reply-wrap {
  display:flex;gap:8px;align-items:center;
}
.story-reply-input {
  flex:1;background:rgba(255,255,255,.12);-webkit-backdrop-filter:blur(12px);
  flex:1;background:rgba(255,255,255,.12);backdrop-filter:blur(12px);
  border:1.5px solid rgba(255,255,255,.25);border-radius:50px;
  color:#fff;padding:11px 18px;font-size:.88rem;
  outline:none;font-family:inherit;
}
.story-reply-input::placeholder { color:rgba(255,255,255,.5); }
.story-reply-input:focus { border-color:rgba(255,255,255,.55);background:rgba(255,255,255,.18); }
.story-reply-send {
  width:42px;height:42px;border-radius:50%;flex-shrink:0;
  background:linear-gradient(135deg,var(--verde-dark),var(--verde-light));
  color:#fff;font-size:.9rem;display:flex;align-items:center;justify-content:center;
  transition:opacity .15s;
}
.story-reply-send:hover { opacity:.85; }
.story-mute-btn {
  color:#fff;font-size:1rem;padding:8px;background:rgba(0,0,0,.3);
  border-radius:50%;width:36px;height:36px;display:flex;align-items:center;justify-content:center;
}
/* Sound activation pill – centre of screen, hard to miss */
.story-sound-pill {
  position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  z-index:20;
  background:rgba(0,0,0,.72);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
  border:1.5px solid rgba(255,255,255,.35);border-radius:50px;
  color:#fff;font-size:.88rem;font-weight:700;letter-spacing:.3px;
  padding:13px 22px;display:flex;align-items:center;gap:9px;cursor:pointer;
  animation:soundPillPulse 1.4s ease-in-out infinite;
  white-space:nowrap;
}
.story-sound-pill i { font-size:1.1rem; }
.story-sound-pill.active { animation:none;background:rgba(0,168,107,.8); }
@keyframes soundPillPulse {
  0%,100%{box-shadow:0 0 0 0 rgba(255,255,255,.35)}
  50%{box-shadow:0 0 0 10px rgba(255,255,255,0)}
}

/* ===== CHAT ===== */
.chat-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.chat-sidebar {
  width: 360px;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-sidebar-header, .chat-main-header {
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chat-sidebar-header h2 { font-size: 1.1rem; font-weight: 800; flex: 1; }
.conversations-list { flex: 1; overflow-y: auto; }
.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-radius: var(--radius-md);
  margin: 2px 8px;
}
.conversation-item:hover, .conversation-item.active { background: var(--glass-hover); }
.conversation-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.conversation-info { flex: 1; min-width: 0; }
.conversation-name { font-size: 0.9rem; font-weight: 700; }
.conversation-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conversation-meta { text-align: right; flex-shrink: 0; }
.conversation-time { font-size: 0.72rem; color: var(--text-muted); }
.unread-dot {
  width: 10px;
  height: 10px;
  background: var(--verde-light);
  border-radius: 50%;
  margin-left: auto;
  margin-top: 4px;
}
.messages-container { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.message-item { display: flex; align-items: flex-end; gap: 8px; max-width: 75%; }
.message-item.own { align-self: flex-end; flex-direction: row-reverse; }
.message-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.message-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}
.message-item:not(.own) .message-bubble {
  background: var(--bg-elevated);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}
.message-item.own .message-bubble {
  background: linear-gradient(135deg, var(--verde), var(--verde-light));
  color: white;
  border-bottom-right-radius: 4px;
}
.message-time { font-size: 0.7rem; color: var(--text-muted); margin: 0 4px 2px; }
.chat-input-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}
.chat-input:focus { border-color: var(--verde-light); }
.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--verde), var(--verde-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: transform var(--transition-spring), box-shadow var(--transition-fast);
}
.chat-send-btn:hover { transform: scale(1.1); box-shadow: 0 4px 16px rgba(0,104,71,0.4); }

/* Story reply preview card inside chat bubbles */
.story-reply-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.06);
  border-left: 3px solid var(--verde-light);
  border-radius: 10px 10px 0 0;
  padding: 8px 10px;
  margin-bottom: 3px;
  max-width: 220px;
  cursor: default;
}
.message-item.own .story-reply-card { border-left-color: rgba(255,255,255,.5); }
.story-reply-thumb {
  width: 38px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,.1);
}
.story-reply-video-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.6);
  font-size: .85rem;
  background: rgba(255,255,255,.1);
}
.story-reply-expired {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.3);
  font-size: .75rem;
  background: rgba(255,255,255,.05);
}
.story-reply-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--verde-light);
}
.message-item.own .story-reply-label { color: rgba(255,255,255,.7); }

.chat-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 12px;
}
.chat-empty i { font-size: 3rem; opacity: 0.3; }

/* ===== UPLOAD ===== */
.upload-page { max-width: 680px; margin: 0 auto; padding: 24px 16px 80px; }
.upload-area {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--glass);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--verde-light);
  background: rgba(0,168,107,0.05);
}
.upload-area i { font-size: 3rem; color: var(--text-muted); margin-bottom: 16px; }
.upload-area h3 { font-size: 1.1rem; margin-bottom: 8px; }
.upload-area p { color: var(--text-muted); font-size: 0.85rem; }
.upload-preview {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  margin-bottom: 16px;
}
.upload-preview img, .upload-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.filter-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
  margin-bottom: 16px;
}
.filter-strip::-webkit-scrollbar { display: none; }
.filter-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-spring);
}
.filter-chip:hover { transform: scale(1.05); }
.filter-chip-thumb {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color var(--transition-fast);
}
.filter-chip.active .filter-chip-thumb { border-color: var(--verde-light); }
.filter-chip-name {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.filter-chip.active .filter-chip-name { color: var(--verde-light); }
.collage-grid-templates {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.collage-template-btn {
  flex: 1;
  padding: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.75rem;
  color: var(--text-muted);
}
.collage-template-btn:hover, .collage-template-btn.active {
  border-color: var(--verde-light);
  color: var(--verde-light);
  background: rgba(0,168,107,0.08);
}
.collage-template-icon { font-size: 1.4rem; }

/* ===== NOTIFICATIONS PANEL ===== */
.notif-panel {
  position: fixed;
  left: calc(var(--sidebar-w) + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-10px);
  width: 340px;
  max-height: 70vh;
  z-index: 150;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-lg);
}
.notif-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}
.notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
}
.notif-overlay.open { display: block; }
.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--glass-border);
}
.notif-panel-header h3 { font-size: 1rem; font-weight: 800; }
.notif-read-all { font-size: 0.8rem; color: var(--verde-light); cursor: pointer; }
.notif-list { flex: 1; overflow-y: auto; padding: 8px; }
.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.notif-item:hover { background: var(--glass-hover); }
.notif-item.unread { background: rgba(0,168,107,0.06); }
.notif-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.notif-text { flex: 1; font-size: 0.82rem; line-height: 1.4; }
.notif-text strong { font-weight: 700; }
.notif-time { font-size: 0.72rem; color: var(--text-muted); }
.notif-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}
.notif-dot-small {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--verde-light);
  flex-shrink: 0;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-spring);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-header h3 { font-size: 1rem; font-weight: 800; }
.modal-close {
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 6px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--glass-hover); color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== COMMENTS MODAL ===== */
.comments-list { max-height: 50vh; overflow-y: auto; }
.comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-text { font-size: 0.88rem; line-height: 1.5; }
.comment-text strong { font-weight: 700; cursor: pointer; }
.comment-text strong:hover { color: var(--verde-light); }
.comment-footer {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.comment-time { font-size: 0.72rem; color: var(--text-muted); }
.comment-like-btn, .comment-reply-btn {
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  transition: color var(--transition-fast);
}
.comment-like-btn:hover { color: var(--rojo-light); }
.comment-reply-btn:hover { color: var(--text-primary); }

/* ===== ADMIN ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-layout { display: flex; min-height: 100dvh; }
.admin-sidebar {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--glass-border);
  padding: 20px 12px;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}
.admin-main { flex: 1; margin-left: 220px; padding: 28px; min-height: 100vh; }
.admin-main { flex: 1; margin-left: 220px; padding: 28px; min-height: 100dvh; }
.admin-logo { font-size: 1.3rem; font-weight: 900; padding: 12px; margin-bottom: 24px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; }
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.admin-nav-link:hover, .admin-nav-link.active {
  background: var(--glass-hover);
  color: var(--text-primary);
}
.admin-nav-link.active { color: var(--verde-light); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition-normal);
}
.stat-card:hover { transform: translateY(-3px); }
.stat-card-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.stat-card-icon.green { background: rgba(0,104,71,0.2); color: var(--verde-light); }
.stat-card-icon.red   { background: rgba(206,17,38,0.2); color: var(--rojo-light); }
.stat-card-icon.gold  { background: rgba(212,175,55,0.2); color: var(--oro-light); }
.stat-card-icon.blue  { background: rgba(59,130,246,0.2); color: #60a5fa; }
.stat-card-value { font-size: 1.6rem; font-weight: 800; }
.stat-card-label { font-size: 0.8rem; color: var(--text-muted); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--glass-border);
}
.data-table td {
  padding: 12px 16px;
  font-size: 0.87rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--glass); }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}
.badge-green  { background: rgba(0,104,71,0.2);  color: var(--verde-light); }
.badge-red    { background: rgba(206,17,38,0.2);  color: var(--rojo-light); }
.badge-yellow { background: rgba(212,175,55,0.2); color: var(--oro-light); }
.badge-gray   { background: var(--glass);          color: var(--text-muted); }

/* ===== TOAST ===== */
#toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
  pointer-events: auto;
  white-space: nowrap;
}
.toast.success { border-color: var(--verde-light); color: var(--verde-light); }
.toast.error   { border-color: var(--rojo-light);  color: var(--rojo-light); }
.toast.hiding  { animation: toast-out 0.25s ease forwards; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ===== SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-card) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.skeleton-post {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.skeleton-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-line { height: 12px; }
.skeleton-line-short { width: 40%; }
.skeleton-image { width: 100%; aspect-ratio: 1; }

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-verde  { color: var(--verde-light); }
.text-rojo   { color: var(--rojo-light); }
.text-oro    { color: var(--oro-light); }
.mt-auto { margin-top: auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.overflow-hidden { overflow: hidden; }
.divider { height: 1px; background: var(--glass-border); margin: 16px 0; }
.section-title {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title i { color: var(--verde-light); }
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 12px;
}
.empty-state i { font-size: 3rem; color: var(--text-muted); opacity: 0.4; }
.empty-state p { color: var(--text-muted); font-size: 0.9rem; }
.suggested-users { display: flex; flex-direction: column; gap: 12px; }
.suggested-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.suggested-user:hover { background: var(--glass-hover); }
.suggested-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.suggested-info { flex: 1; min-width: 0; }
.suggested-name { font-size: 0.88rem; font-weight: 700; }
.suggested-meta { font-size: 0.76rem; color: var(--text-muted); }

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fade-in 0.4s ease forwards;
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.slide-up {
  animation: slide-up 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Post card entrance animation */
.post-card-anim {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.22,1,.36,1);
}
.post-card-anim.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Story item spring animation */
.story-item {
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.story-item:active { transform: scale(.93); }

/* Bottom nav item press feedback */
.bottom-nav-item:active { transform: scale(.88); }

/* Explore grid item active tap zoom */
.collage-item:active img,
.collage-item:active video { transform: scale(1.04); }

/* Profile grid item press */
.profile-grid-item:active img { transform: scale(1.04); }

/* Reel action spring tap */
.reel-action:active { transform: scale(.82); }

/* Post action bounce on tap */
.post-action-btn:active { transform: scale(.85); }
.post-action-btn.liked { animation: like-pop .25s cubic-bezier(.34,1.56,.64,1); }
@keyframes like-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Page enter */
.app-main {
  animation: page-enter .3s ease both;
}
@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.heart-burst {
  animation: heart-burst 0.4s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
@keyframes heart-burst {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.floating-heart {
  position: absolute;
  pointer-events: none;
  font-size: 2.5rem;
  color: var(--rojo-light);
  opacity: 0;
  animation: floating-heart-anim 0.8s ease forwards;
}
@keyframes floating-heart-anim {
  0%   { opacity: 1; transform: scale(0.5) translateY(0); }
  50%  { opacity: 1; transform: scale(1.5) translateY(-40px); }
  100% { opacity: 0; transform: scale(1) translateY(-80px); }
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.auth-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  pointer-events: none;
}
.glow-green {
  width: 500px; height: 500px;
  background: var(--verde);
  top: -100px; left: -150px;
}
.glow-red {
  width: 400px; height: 400px;
  background: var(--rojo);
  bottom: -100px; right: -100px;
}
.auth-card {
  background: rgba(15,15,15,0.9);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 8px;
}
.auth-logo .logo-text { font-size: 2.2rem; letter-spacing: -2px; }
.auth-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 32px;
}
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 8px 0;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}
.auth-link { text-align: center; font-size: 0.85rem; color: var(--text-secondary); }
.auth-link a { color: var(--verde-light); font-weight: 700; }
.auth-link a:hover { text-decoration: underline; }

/* ===== LANDING PAGE ===== */
.landing-page {
  background: var(--bg-base);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10,10,10,0.8);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}
.landing-nav-logo { font-size: 1.8rem; font-weight: 900; letter-spacing: -2px; }
.landing-nav-actions { display: flex; gap: 12px; align-items: center; }
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px 60px;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 20% 50%, rgba(0,104,71,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 50%, rgba(206,17,38,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 50% 80%, rgba(212,175,55,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--verde-light);
  margin-bottom: 24px;
  animation: slide-up 0.6s ease both;
}
.hero-title {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 24px;
  animation: slide-up 0.6s 0.1s ease both;
}
.hero-title .highlight {
  background: linear-gradient(135deg, var(--verde-neon), var(--verde-light), var(--oro-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 40px;
  line-height: 1.7;
  animation: slide-up 0.6s 0.2s ease both;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  animation: slide-up 0.6s 0.3s ease both;
}
.hero-mockup {
  margin-top: 60px;
  position: relative;
  animation: slide-up 0.8s 0.4s ease both;
}
.mockup-phones {
  display: flex;
  justify-content: center;
  gap: -20px;
  position: relative;
}
.mockup-phone {
  width: 220px;
  height: 400px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
}
.mockup-phone.center {
  transform: translateY(-20px) scale(1.05);
  z-index: 2;
  border-color: rgba(0,255,157,0.3);
  box-shadow: 0 32px 80px rgba(0,0,0,0.8), 0 0 60px rgba(0,255,157,0.1);
}
.mockup-phone-img { width: 100%; height: 100%; object-fit: cover; }
.features-section {
  padding: 100px 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--verde), var(--rojo));
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255,255,255,0.12);
  box-shadow: var(--shadow-lg);
}
.feature-card:hover::before { opacity: 1; }
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}
.feature-icon.verde { background: rgba(0,104,71,0.2); color: var(--verde-light); }
.feature-icon.rojo  { background: rgba(206,17,38,0.2); color: var(--rojo-light); }
.feature-icon.oro   { background: rgba(212,175,55,0.2); color: var(--oro-light); }
.feature-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 10px; }
.feature-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }
.section-eyebrow {
  display: inline-block;
  color: var(--verde-light);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.section-heading {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 16px;
}
.section-subheading {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 520px;
}
.landing-footer {
  border-top: 1px solid var(--glass-border);
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== SETTINGS ===== */
.settings-page { max-width: 700px; margin: 0 auto; padding: 24px 16px 80px; }
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.settings-section-title {
  padding: 14px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-elevated);
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition-fast);
}
.settings-row:last-child { border-bottom: none; }
.settings-row:hover { background: var(--glass); }
.settings-row-label { font-size: 0.9rem; }
.settings-row-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all var(--transition-normal);
}
.toggle input:checked + .toggle-slider {
  background: rgba(0,104,71,0.3);
  border-color: var(--verde-light);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: var(--verde-light);
}

/* ===== BOTTOM NAV LABELS ===== */
.bottom-nav-label {
  font-size: .55rem;
  font-weight: 600;
  margin-top: 3px;
  line-height: 1;
  letter-spacing: .3px;
  opacity: .7;
  transition: opacity var(--transition-fast);
}
.bottom-nav-item.active .bottom-nav-label { opacity: 1; }
.bottom-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid transparent;
  transition: border-color var(--transition-fast);
}
.bottom-avatar.active { border-color: var(--verde-neon); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 72px; }
  .sidebar-logo .logo-text,
  .nav-link span,
  .sidebar-user-info,
  .sidebar-logout { display: none; }
  .nav-link { justify-content: center; padding: 14px; }
  .sidebar-user-link { justify-content: center; padding: 6px; }
  .sidebar-user { justify-content: center; }
  .notif-panel { left: calc(72px + 10px); }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
    --bottom-nav-h: 72px;
  }
  .sidebar { display: none; }
  .app-main { margin-left: 0; padding-top: var(--header-h); padding-bottom: calc(var(--bottom-nav-h) + 4px); }
  .mobile-header { display: flex; }
  .bottom-nav {
    display: flex;
    height: var(--bottom-nav-h);
    padding: 0 6px;
    padding-bottom: env(safe-area-inset-bottom, 6px);
    align-items: center;
    gap: 2px;
  }
  .bottom-nav-item {
    flex-direction: column;
    width: auto;
    height: auto;
    padding: 6px 0 4px;
    border-radius: 12px;
    font-size: 1.25rem;
  }
  .bottom-create {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 1.3rem;
    margin-bottom: 0;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(0,104,71,.5);
    transition: transform var(--transition-spring), box-shadow var(--transition-fast);
  }
  .bottom-create:active { transform: scale(.93); }
  .bottom-avatar { width: 26px; height: 26px; }
  .notif-panel { left: 12px; right: 12px; width: auto; top: auto; bottom: calc(var(--bottom-nav-h) + 12px); transform: none; }
  .notif-panel.open { transform: none; }
  /* Profile: Instagram-style mobile layout */
  .profile-cover { height: 140px; border-radius: 0; margin-bottom: 0; }
  .profile-cover-default { border-radius: 0 !important; margin-bottom: 0 !important; height: 140px !important; }
  .profile-header {
    grid-template-columns: 88px 1fr;
    column-gap: 16px;
    row-gap: 0;
    padding: 0 16px;
    margin-top: -44px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
  }
  .profile-avatar-wrap { grid-column: 1; grid-row: 1; }
  .profile-info { grid-column: 2; grid-row: 1; padding-top: 48px; }
  .profile-bio-section {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 4px;
  }
  .profile-avatar { width: 88px; height: 88px; border: 3px solid var(--bg-base); }
  .avatar-edit-btn { width: 26px; height: 26px; font-size: .7rem; bottom: 2px; right: 2px; }
  .profile-username-h { font-size: 1.05rem; font-weight: 700; }
  .profile-top-row { gap: 8px; margin-bottom: 6px; flex-wrap: nowrap; justify-content: flex-start; }
  .profile-stats { justify-content: space-around; gap: 0; margin-bottom: 0; }
  .profile-stat { flex: 1; align-items: center; }
  .stat-number { font-size: .95rem; }
  .stat-label { font-size: .68rem; }
  .profile-bio { text-align: left; max-width: 100%; font-size: .88rem; margin-bottom: 4px; }
  .profile-edit-desktop { display: none !important; }
  .profile-msg-desktop { display: none !important; }
  .profile-edit-mobile {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 12px;
    font-size: .9rem;
    padding: 9px 16px;
  }
  .chat-sidebar { width: 100%; }
  .chat-main { display: none; }
  .chat-main.active { display: flex; }
  .chat-sidebar.hidden { display: none; }
  .mobile-back-btn { display: flex !important; }
  .chat-main-header { padding: 10px 14px; }
  .messages-container { padding: 12px; }
  .message-item { max-width: 85%; }
  .chat-input-bar { padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .auth-card { padding: 28px 24px; }
  .landing-nav { padding: 14px 20px; }
  .hero-title { letter-spacing: -1px; }
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; padding: 16px; }
  .features-grid { grid-template-columns: 1fr; }

  /* Feed full-bleed cards on mobile */
  .feed-container { padding: 0 0 8px; }
  .post-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    margin-bottom: 6px;
  }

  /* Mobile header glow */
  .mobile-logo { font-size: 1.5rem; letter-spacing: -1.5px; }
  .mobile-icon-btn { width: 40px; height: 40px; font-size: 1.15rem; }

  /* Stories bar better spacing */
  .stories-bar { gap: 14px; padding: 14px 16px; }
  .story-avatar-wrap,
  .story-avatar-ring,
  .story-add-btn { width: 62px; height: 62px; }
  .story-name { font-size: .7rem; max-width: 62px; }

  /* Notification dot pulse */
  .notif-dot { animation: notif-pulse 2s ease infinite; }
  @keyframes notif-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(206,17,38,.6); }
    50%      { box-shadow: 0 0 0 4px rgba(206,17,38,0); }
  }
}

@media (max-width: 480px) {
  .profile-grid { gap: 1.5px; }
  .explore-grid { gap: 1.5px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { border-radius: var(--radius-lg); }
  .profile-avatar { width: 78px; height: 78px; }
  .profile-header { grid-template-columns: 78px 1fr; margin-top: -39px; }
  .profile-cover { height: 115px; }
  .profile-cover-default { height: 115px !important; }

  /* Post media slightly taller than square on mobile */
  .post-media { aspect-ratio: 1; }

  /* Action buttons bigger touch targets */
  .post-action-btn { padding: 10px 12px; font-size: 1rem; }
  .post-action-btn i { font-size: 1.25rem; }
  .action-count { font-size: .82rem; }

  /* Comment input better on mobile */
  .post-comment-input { padding: 10px 14px 14px; }
  .comment-text-input { font-size: .88rem; padding: 10px 14px; }

  /* Caption legibility */
  .post-caption { font-size: .92rem; }
  .post-likes-text { font-size: .88rem; }

  /* Profile page mobile */
  .profile-page { padding: 0 0 80px; }
  .profile-tabs {
    margin: 0 0 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .profile-tabs::-webkit-scrollbar { display: none; }
  .profile-tab { flex: 1 0 auto; font-size: .72rem; letter-spacing: .5px; padding: 11px 10px; min-width: 64px; }

  /* Explore grid mobile */
  .collage-grid { gap: 1.5px; }
}

/* ===================================================
   NUEVAS FUNCIONALIDADES — MEXGRAM FEATURE UPDATE
   =================================================== */

/* ---------- LIGHT THEME VARIABLES ---------- */
[data-theme="light"] {
  --bg-primary:    #f0f2f5;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #e4e6ea;
  --bg-card:       #ffffff;
  --bg-glass:      rgba(255,255,255,0.85);
  --text-primary:  #1c1e21;
  --text-secondary:#65676b;
  --text-muted:    #90949c;
  --border-color:  #dddfe2;
  --border-light:  #e4e6ea;
  --hover-bg:      rgba(0,0,0,0.05);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.10);
  --sidebar-bg:    #ffffff;
  --input-bg:      #f0f2f5;
  --overlay:       rgba(255,255,255,0.7);
}

/* ---------- THEME TOGGLE BUTTON ---------- */
.theme-toggle {
  display: none !important;
  position: fixed;
  bottom: 88px;
  right: 20px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
}
.theme-toggle:hover {
  transform: scale(1.12) rotate(15deg);
  box-shadow: 0 6px 20px rgba(0,168,107,0.35);
}
@media (min-width: 769px) {
  .theme-toggle { bottom: 24px; right: 24px; }
}

/* ---------- PAGE TRANSITIONS ---------- */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pageOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}
.page-transition-enter { animation: pageIn .35s cubic-bezier(.22,1,.36,1) both; }
.page-transition-exit  { animation: pageOut .2s ease forwards; }
.main-content, .feed-container, .explore-container, .profile-page { animation: pageIn .4s cubic-bezier(.22,1,.36,1) both; }

/* ---------- SKELETON LOADERS ---------- */
@keyframes shimmer {
  0%   { background-position: -800px 0; }
  100% { background-position:  800px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}
.skeleton-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.full { width: 100%; }
.skeleton-media {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  margin: 12px 0;
}
.skeleton-actions { display: flex; gap: 16px; margin-top: 8px; }
.skeleton-action { width: 60px; height: 28px; border-radius: 20px; }

/* ---------- DOWNLOAD BUTTON ---------- */
.post-download-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  transition: color .2s, transform .2s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.post-download-btn:hover { color: var(--accent-green); transform: translateY(-2px); }
.post-download-btn:active { transform: scale(.9); }
.post-download-btn .dl-progress {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.post-download-btn.loading i { display: none; }
.post-download-btn.loading .dl-progress { display: block; }

/* ---------- SHARE NATIVE BUTTON ---------- */
.post-share-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  transition: color .2s, transform .2s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.post-share-btn:hover { color: var(--accent-blue, #1877f2); transform: translateY(-2px); }
.post-share-btn:active { transform: scale(.9); }

/* ---------- COMMENT REACTIONS ---------- */
.reaction-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
.reaction-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 3px 5px;
  border-radius: 8px;
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), background .15s;
  line-height: 1;
}
.reaction-btn:hover { transform: scale(1.35); background: var(--hover-bg); }
.reaction-btn:active { transform: scale(.85); }
.reaction-btn.selected { background: rgba(0,168,107,.15); }
.reaction-count {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 14px;
}

/* Comment reaction picker popup */
.reaction-picker {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 6px 10px;
  display: flex;
  gap: 6px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  opacity: 0;
  transform: scale(.7) translateY(10px);
  pointer-events: none;
  transition: opacity .18s, transform .2s cubic-bezier(.34,1.56,.64,1);
}
.reaction-picker.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}
.reaction-picker-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 2px 4px;
  border-radius: 50%;
  transition: transform .15s;
}
.reaction-picker-btn:hover { transform: scale(1.4); }

/* ---------- STORIES WITH MUSIC ---------- */
.story-music-bar {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 6px 14px 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
  max-width: 80%;
  z-index: 20;
  animation: musicBarIn .3s ease;
}
@keyframes musicBarIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.music-note-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg,#006847,#00a86b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: #fff;
  flex-shrink: 0;
  animation: musicRotate 3s linear infinite;
}
@keyframes musicRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.music-info { flex: 1; overflow: hidden; }
.music-title {
  font-size: .72rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: marquee 8s linear infinite;
}
@keyframes marquee {
  0%,20% { transform: translateX(0); }
  80%,100% { transform: translateX(-50%); }
}
.music-artist { font-size: .62rem; color: rgba(255,255,255,.7); }
.music-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  flex-shrink: 0;
}
.music-wave span {
  display: block;
  width: 3px;
  border-radius: 3px;
  background: #00a86b;
  animation: wave-bar 1s ease-in-out infinite;
}
.music-wave span:nth-child(1) { height: 60%; animation-delay: 0s; }
.music-wave span:nth-child(2) { height: 100%; animation-delay: .15s; }
.music-wave span:nth-child(3) { height: 40%; animation-delay: .3s; }
.music-wave span:nth-child(4) { height: 80%; animation-delay: .1s; }
.music-wave span:nth-child(5) { height: 55%; animation-delay: .25s; }
@keyframes wave-bar {
  0%,100% { transform: scaleY(1); }
  50%      { transform: scaleY(.4); }
}

/* ---------- SUGGESTED USERS CARD (FEED) ---------- */
.feed-suggestions {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}
.feed-suggestions-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 12px;
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background .15s;
}
.suggestion-item:last-child { border-bottom: none; padding-bottom: 0; }
.suggestion-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.suggestion-info { flex: 1; min-width: 0; }
.suggestion-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-handle {
  font-size: .76rem;
  color: var(--text-muted);
}
.suggestion-follow-btn {
  background: var(--accent-green);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
  flex-shrink: 0;
}
.suggestion-follow-btn:hover { opacity: .85; transform: scale(1.04); }
.suggestion-follow-btn.following {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* ---------- PWA INSTALL BANNER ---------- */
.pwa-install-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 1200;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 280px;
  max-width: 380px;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.pwa-install-banner.visible { transform: translateX(-50%) translateY(0); }
.pwa-banner-icon { font-size: 2rem; flex-shrink: 0; }
.pwa-banner-text { flex: 1; }
.pwa-banner-title { font-weight: 700; font-size: .95rem; color: var(--text-primary); }
.pwa-banner-sub { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.pwa-install-btn {
  background: var(--accent-green);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
}
.pwa-install-btn:hover { opacity: .85; }
.pwa-banner-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .9rem;
  padding: 4px;
  flex-shrink: 0;
}

/* ---------- NOTIFICATION TOAST ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: 320px;
  pointer-events: all;
  animation: toastIn .35s cubic-bezier(.34,1.56,.64,1) both;
  font-size: .88rem;
  color: var(--text-primary);
}
.toast.removing { animation: toastOut .25s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--accent-green); }
.toast-error .toast-icon { color: #ce1126; }
.toast-info .toast-icon { color: #1877f2; }

/* Post menu visibility */
.post-menu { display: none; }
.post-menu.open { display: block; }

/* Desktop sidebar right show via JS */
.desktop-sidebar-right { display: none; }

/* Reaction picker relative parent */
.cm-item { position: relative; }

@keyframes fadeIn {
  from { opacity:0; transform:scale(.96); }
  to   { opacity:1; transform:scale(1); }
}

/* =====================================================
   MEXGRAM - Responsive Mobile Fixes
   ===================================================== */

/* ── TODOS LOS MÓVILES (<768px) ── */
@media (max-width: 768px) {
  .feed-container { padding: 0 8px; }
  .post-card { border-radius: 14px; margin-bottom: 12px; }
  .stories-bar { padding: 10px 8px; gap: 10px; }
  .story-item { min-width: 58px; }
  .story-avatar-wrap { width: 58px; height: 58px; }
  .notif-panel { left: 8px !important; right: 8px !important; width: auto !important; }
  .profile-stats { gap: 14px; }
  .profile-stat-value { font-size: 1.1rem; }
  .modal, .create-card { max-width: 96vw !important; width: 96vw !important; }
  .chat-sidebar { transition: transform .3s cubic-bezier(.4,0,.2,1); }
  .explore-grid { grid-template-columns: repeat(3,1fr); gap: 2px; }
  .sidebar { display: none !important; }
  .main-content { margin-left: 0 !important; padding-bottom: calc(var(--bottom-nav-h) + 12px); }
  .bottom-nav { display: flex !important; }
  .mobile-header { display: flex !important; }
  .upload-preview, .preview-wrap { max-height: 60vh; }
  .camera-container { border-radius: 16px; max-height: 65vh; }
  .post-actions { padding: 8px 12px; gap: 14px; }
  .comment-input-wrap { padding: 8px 12px; }
  .bottom-nav-item { font-size: .58rem; }
  .bottom-nav-item i { font-size: 1.15rem; }
  .profile-cover { border-radius: 0; }
  .profile-info { padding: 0 12px; }
  .reels-container { height: 100dvh; }
  .settings-card { padding: 16px 12px; }
  .settings-section { padding: 0; }
  .btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
}

/* ── TELÉFONOS PEQUEÑOS (<480px) ── */
@media (max-width: 480px) {
  :root {
    --header-h: 54px;
    --bottom-nav-h: 64px;
  }
  .feed-container { padding: 0; }
  .post-card { border-radius: 0; margin-bottom: 8px; box-shadow: none; border-left: none; border-right: none; }
  .post-header { padding: 10px 12px; }
  .post-media img, .post-media video { max-height: 75vw; }
  .post-actions { padding: 6px 12px; }
  .stories-bar { padding: 8px 6px; gap: 8px; }
  .story-avatar-wrap { width: 52px; height: 52px; }
  .story-name { font-size: .6rem; }
  .explore-grid { gap: 1px; }
  .profile-stats { gap: 10px; padding: 10px 12px; }
  .modal { padding: 16px 12px !important; border-radius: 18px !important; }
  .mobile-logo { font-size: 1.3rem; }
  h1 { font-size: 1.3rem !important; }
  h2 { font-size: 1.1rem !important; }
  .btn-lg { padding: 14px 18px; font-size: .9rem; }
  .bottom-nav { padding: 0 2px; }
  .bottom-nav-item { padding: 6px 2px 2px; gap: 2px; }
  .bottom-create { width: 46px; height: 46px; }
  .input-field { font-size: 16px; }  /* Prevents iOS zoom on focus */
  .auth-card { padding: 20px 16px; border-radius: 20px; }
  textarea, input[type="text"], input[type="email"], input[type="password"] {
    font-size: 16px !important; /* iOS no-zoom */
  }
}

/* ── LANDSCAPE MÓVIL ── */
@media (max-width: 768px) and (orientation: landscape) {
  .camera-container { max-height: 90vh; }
  .reels-container { height: 100vw; }
  #bottom-nav { display: none; }
  .main-content { padding-bottom: 0; }
}

/* ── TOUCH IMPROVEMENTS ── */
@media (hover: none) and (pointer: coarse) {
  .btn, .nav-link, .bottom-nav-item, .post-action-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .post-card:hover { transform: none; }
  a:hover { opacity: 1; }
}

/* =====================================================
   MEXGRAM MX-FIXES — bloque único consolidado
   ===================================================== */

/* Mobile header: mensajes y notificaciones visibles */
.mobile-icon-btn {
  color: rgba(210,210,210,.9) !important;
  font-size: 1.2rem !important;
  width: 38px !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  position: relative;
  flex-shrink: 0;
}
.mobile-icon-btn i { color: rgba(210,210,210,.9) !important; }
.mobile-header-actions { display: flex !important; align-items: center !important; gap: 2px !important; }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: #ce1126; border-radius: 50%;
  border: 2px solid rgba(10,10,10,.97);
}

/* Bottom nav: iconos y labels visibles */
.bottom-nav-item { color: rgba(210,210,210,.88) !important; flex: 1; }
.bottom-nav-item.active { color: var(--verde-neon) !important; }
.bottom-nav-item i { font-size: 1.2rem; display: block; line-height: 1; }
.bottom-nav-label {
  display: block !important;
  font-size: .55rem !important;
  font-weight: 600;
  margin-top: 3px;
  opacity: 1 !important;
  color: inherit;
  text-align: center;
  white-space: nowrap;
  line-height: 1;
}
.bottom-nav-item.active .bottom-nav-label { color: var(--verde-neon) !important; }
.bottom-avatar {
  width: 23px !important; height: 23px !important;
  border-radius: 50% !important; object-fit: cover;
  border: 2px solid rgba(200,200,200,.45) !important;
  background: #2a2a2a; display: block;
}
.bottom-nav-item.active .bottom-avatar { border-color: var(--verde-neon) !important; }
.bottom-create {
  flex: 0 0 46px !important; width: 46px !important; height: 46px !important;
  border-radius: 14px !important; display: flex !important;
  align-items: center !important; justify-content: center !important;
  margin: 0 2px;
  background: linear-gradient(135deg, var(--verde), var(--verde-light)) !important;
  color: #fff !important;
  box-shadow: 0 4px 18px rgba(0,104,71,.5) !important;
}
.bottom-create i { font-size: 1.25rem !important; color: #fff !important; }

/* Camara AR */
.bottom-cam { color: rgba(0,200,118,.9) !important; }
.bottom-cam i { color: rgba(0,200,118,.9) !important; }
.bottom-cam.active,
.bottom-cam.active i { color: var(--verde-neon) !important; }
.bottom-cam .bottom-nav-label { color: rgba(0,200,118,.9) !important; }
.bottom-cam.active .bottom-nav-label { color: var(--verde-neon) !important; }

/* Responsive consolidado */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; --bottom-nav-h: 68px; }
  .sidebar { display: none !important; }
  .mobile-header { display: flex !important; }
  .mobile-header-actions { display: flex !important; align-items: center !important; }
  .app-main { margin-left: 0 !important; padding-top: var(--header-h); padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 4px); }
  .bottom-nav {
    display: flex !important;
    height: var(--bottom-nav-h) !important;
    justify-content: space-between !important;
    padding: 0 4px !important;
    padding-bottom: env(safe-area-inset-bottom, 4px) !important;
    align-items: center;
  }
  .bottom-nav-item { padding: 5px 0 3px !important; min-width: 0 !important; flex: 1 !important; }
  .bottom-nav-item i { font-size: 1.1rem !important; }
  .bottom-nav-label { font-size: .52rem !important; }
  .reel-info    { bottom: calc(var(--bottom-nav-h) + 24px) !important; }
  .reel-actions { bottom: calc(var(--bottom-nav-h) + 28px) !important; }
  .notif-panel { left: 8px !important; right: 8px !important; width: auto !important; bottom: calc(var(--bottom-nav-h) + 8px) !important; top: auto !important; }
}
@media (max-width: 480px) {
  :root { --bottom-nav-h: 62px; }
  .bottom-nav-item i { font-size: 1.05rem !important; }
  .bottom-nav-label { font-size: .5rem !important; }
}

/* MX:admin-mobile-v4 */
/* Force sidebar background to be always visible */
.admin-sidebar {
  background: #111 !important;
  border-right: 1px solid rgba(255,255,255,.1) !important;
}

/* Mobile top bar */
.admin-top-bar {
  display: none;
  position: fixed; top:0; left:0; right:0; z-index:200; height:54px;
  background: #111;
  border-bottom: 1px solid rgba(255,255,255,.12);
  align-items: center; justify-content: space-between; padding: 0 16px;
}
.admin-hamburger {
  width:38px; height:38px; border-radius:10px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: #fff; font-size:1.1rem; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  touch-action: manipulation;
}
.atb-logo { font-size:1.1rem; font-weight:900; }
.atb-logo .logo-mx { color: #00ff9d; }

/* Sidebar overlay backdrop */
.admin-sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 198;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.admin-sidebar-overlay.open { display: block; }

/* Close button inside sidebar (mobile only) */
.admin-sidebar-close-btn {
  display: none; align-items: center; justify-content: flex-end;
  margin-bottom: 8px; padding: 0 8px;
}
.admin-sidebar-close-btn button {
  background: rgba(255,255,255,.08); border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  font-size: .9rem; display: flex; align-items: center; justify-content: center;
}

/* Admin bottom tab bar */
.admin-bottom-nav {
  display: none;
  position: fixed; bottom:0; left:0; right:0; z-index:200;
  height: 60px;
  background: #111;
  border-top: 1px solid rgba(255,255,255,.12);
  align-items: center; justify-content: space-around;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 4px);
}
.admin-bottom-nav a, .admin-bottom-nav button {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: rgba(200,200,200,.75); font-size: .52rem; font-weight: 700;
  text-decoration: none; background: none; border: none; cursor: pointer;
  padding: 5px 2px 3px; touch-action: manipulation;
  transition: color .15s; letter-spacing: .01em; min-width: 0;
}
.admin-bottom-nav a i, .admin-bottom-nav button i { font-size: 1.1rem; display: block; line-height: 1; }
.admin-bottom-nav a.active, .admin-bottom-nav a.active i { color: #00ff9d; }

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 768px) {
  .admin-top-bar { display: flex !important; }
  .admin-bottom-nav { display: flex !important; }

  /* Sidebar: off-screen to the left using left property (more reliable than transform for fixed) */
  .admin-sidebar {
    position: fixed !important;
    top: 0 !important; bottom: 0 !important;
    left: -280px !important;
    width: 260px !important;
    height: 100% !important;
    z-index: 999 !important;
    overflow-y: auto !important;
    background: #111 !important;
    border-right: 2px solid rgba(0,255,157,.3) !important;
    box-shadow: none !important;
    transition: left .28s cubic-bezier(.4,0,.2,1) !important;
    transform: none !important;
  }
  .admin-sidebar.sidebar-open {
    left: 0 !important;
    box-shadow: 6px 0 40px rgba(0,0,0,.9) !important;
  }
  .admin-sidebar-close-btn { display: flex !important; }

  /* Main content: full width, no left margin */
  .admin-main {
    margin-left: 0 !important;
    padding: 12px !important;
    padding-top: 66px !important;
    padding-bottom: calc(60px + env(safe-area-inset-bottom,0px) + 8px) !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Layout block to prevent flex from reserving space for sidebar */
  .admin-layout { display: block !important; min-height: 100dvh; }

  /* Stats: 2 columns */
  .stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
  }
  .stat-card {
    padding: 12px 10px !important;
    gap: 10px !important;
    border-radius: 14px !important;
    flex-direction: row !important;
    align-items: center !important;
  }
  .stat-card-icon { width:36px !important; height:36px !important; font-size:.9rem !important; flex-shrink:0 !important; border-radius:10px !important; }
  .stat-card-value { font-size: 1.2rem !important; }
  .stat-card-label { font-size: .65rem !important; }

  /* Tables */
  .data-table th, .data-table td { padding: 7px 8px !important; font-size: .75rem !important; }
}

@media (max-width: 480px) {
  .admin-main { padding: 10px !important; padding-top: 64px !important; padding-bottom: calc(60px + env(safe-area-inset-bottom,0px) + 6px) !important; }
  .stats-grid { gap: 6px !important; }
}
