.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Cabecera superior fija */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: rgba(14, 16, 20, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  z-index: 30;
}

/* Área principal con márgenes seguros */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: calc(var(--header-height) + 16px);
  padding-bottom: calc(var(--bottom-nav-height) + 24px);
  padding-left: 16px;
  padding-right: 16px;
}

/* Barra inferior móvil sin botones flotantes sobrepuestos */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  padding: 0 8px;
  z-index: 30;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.bottom-nav__create {
  background-color: var(--accent-primary);
  color: #0B0F17;
  font-weight: 700;
  border-radius: var(--radius-full);
  height: 42px;
  padding: 0 18px;
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Vista dedicada de nota individual (sin barra inferior) */
.note-view .main-content {
  max-width: 860px;
  padding-bottom: 40px;
}

/* Adaptación escritorio (>= 768px) */
@media (min-width: 768px) {
  .app-shell--with-sidebar {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
  }

  .app-shell--with-sidebar .top-bar {
    left: var(--sidebar-width);
  }

  .app-shell--with-sidebar .bottom-nav {
    top: 0;
    right: auto;
    width: var(--sidebar-width);
    height: 100dvh;
    border-top: none;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 16px 12px;
  }

  .app-shell--with-sidebar .bottom-nav__item {
    flex-direction: row;
    justify-content: flex-start;
    height: 44px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    gap: 10px;
  }

  .app-shell--with-sidebar .bottom-nav__item:hover {
    background-color: var(--bg-hover);
  }

  .app-shell--with-sidebar .bottom-nav__create {
    order: -1;
    width: 100%;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
  }

  .app-shell--with-sidebar .main-content {
    grid-column: 2;
    padding-bottom: 32px;
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* =========================================================
   IDENTIDAD VISUAL NOTTO (BURBUJAS, LOGO Y CRISTAL OSCURO)
   ========================================================= */

.app-shell {
  position: relative;
}

.app-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.app-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(85px);
  opacity: 0.18;
  animation: floatAppOrb 18s ease-in-out infinite alternate;
}

.app-orb--blue {
  width: 340px;
  height: 340px;
  background: #3B82F6;
  top: -80px;
  right: -60px;
}

.app-orb--violet {
  width: 360px;
  height: 360px;
  background: #8B5CF6;
  bottom: 40px;
  left: -80px;
  animation-delay: -5s;
}

.app-orb--emerald {
  width: 260px;
  height: 260px;
  background: #10B981;
  top: 42%;
  right: 14%;
  opacity: 0.13;
  animation-delay: -9s;
}

@keyframes floatAppOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-24px, 28px) scale(1.07); }
}

.main-content {
  position: relative;
  z-index: 1;
}

.top-bar {
  background-color: rgba(14, 16, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.bottom-nav {
  background-color: rgba(22, 26, 32, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Lockup de marca Notto (Logo + Nombre en degradado) */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-lockup__logo {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25);
}

.brand-lockup__name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #FFFFFF 20%, #93C5FD 65%, #C4B5FD 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-lockup--sidebar {
  display: none;
}

.top-bar__desktop-title {
  display: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.view-header__title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.view-header__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .brand-lockup--mobile {
    display: none;
  }

  .top-bar__desktop-title {
    display: inline-block;
  }

  .brand-lockup--sidebar {
    display: flex;
    order: -2;
    padding: 6px 10px 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
  }

  .brand-lockup--sidebar .brand-lockup__logo {
    width: 34px;
    height: 34px;
  }

  .brand-lockup--sidebar .brand-lockup__name {
    font-size: 1.4rem;
  }
}

/* Detalle visual para imagen del logo en login y tarjetas con glow */
.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.note-card {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.note-card:hover {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(96, 165, 250, 0.25);
}

.note-card[data-color="amber"]:hover {
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.14);
}
.note-card[data-color="emerald"]:hover {
  box-shadow: 0 10px 26px rgba(16, 185, 129, 0.14);
}
.note-card[data-color="cobalt"]:hover {
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.16);
}
.note-card[data-color="crimson"]:hover {
  box-shadow: 0 10px 26px rgba(239, 68, 68, 0.14);
}
.note-card[data-color="violet"]:hover {
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.16);
}