html,
body {
  height: 100%;
}

body {
  margin: 0;
}

body.ride-map-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  padding: 12px 16px;
  flex: 0 0 auto;
}

.app-main {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  min-height: 0;
  padding-top: 80px;
}

.app-sidebar {
  width: 280px;
  min-width: 280px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 20px 14px;
  align-self: stretch;
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
}

.app-main--internal .app-sidebar {
  position: fixed;
  top: 80px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 900;
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.app-main--internal .app-content {
  margin-left: 280px;
}

.route-view {
  width: 100%;
  min-height: 100%;
  flex: 1 1 auto;
}

#app.has-mobile-nav .app-main--internal .route-view {
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.app-footer {
  padding: 32px 40px 20px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #198FF2;
  color: rgba(255, 255, 255, 0.88);
  flex: 0 0 auto;
}

.app-footer__top {
  display: flex;
  justify-content: space-between;
  gap: 42px;
  flex-wrap: wrap;
  padding: 0;
  margin: 0 auto 24px;
}

.app-footer__brand {
  flex: 1 1 260px;
  max-width: 320px;
}

.app-footer__logo {
  width: 180px;
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 14px;
}

.app-footer__tagline {
  margin: 0;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.95rem;
}

.app-footer__links {
  flex: 2 1 680px;
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 24px;
}

.app-footer__col h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #ffffff;
}

.app-footer__col a {
  display: block;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

.app-footer__col a:hover {
  color: #fff;
}

.app-footer__bottom {
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.app-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 0.9rem;
  color: white;
}

.app-footer__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.side-nav__item--logout {
  width: 100%;
  justify-content: flex-start;
}

.sidebar-user {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f8fafc;
  margin-bottom: 16px;
}

.sidebar-user__name {
  font-weight: 700;
  font-size: 12px;
  color: #101828;
}

.sidebar-user__meta {
  font-size: 11px;
  color: #667085;
  margin-top: 4px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.side-nav__item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
}

.side-nav__item.is-active {
  border-color: #101828;
  background: #f2f4f7;
}

.side-nav__icon {
  width: 24px;
  text-align: center;
}

.side-nav__label {
  flex: 1;
}

.app-main--login {
  display: block;
}

.app-main--login .app-content {
  width: 100%;
  display: block;
}

.app-main--login .route-view {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin: 0 auto;
}

/* MOBILE BOTTOM NAV */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  .app-footer__links {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .app-main {
    padding-top: 82px;
  }

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

  .app-sidebar {
    display: none !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 6px;
    min-height: 82px;
    padding: 10px 10px calc(12px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.12);
  }

  .mobile-bottom-nav__item {
    flex: 1 1 0;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #475467;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 64px;
    padding: 8px 4px;
    border-radius: 14px;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav__item.is-active {
    background: #eef4ff;
    color: #2b4eff;
  }

  .mobile-bottom-nav__icon {
    width: 24px;
    height: 24px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: inherit;
  }

  .mobile-bottom-nav__icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.2;
    display: block;
  }

  .mobile-bottom-nav__label {
    display: block !important;
    width: 100%;
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-bottom-nav .menu-warning {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
    width: 16px;
    height: 16px;
    font-size: 10px;
  }

  .app-content {
    padding-bottom: 0;
  }

  .app-footer {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  #app.has-mobile-nav .app-content {
    padding-bottom: 0;
  }

  #app.has-mobile-nav .app-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .app-main--login .app-content {
    padding-bottom: 0;
  }
}

@media (max-width: 640px) {
  .app-footer {
    padding: 28px 16px 18px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  #app.has-mobile-nav .app-footer {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .app-footer__links {
    grid-template-columns: 1fr;
  }

  .app-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-footer__right {
    width: 100%;
  }
}


/* ==== Header / Footer shell overrides ==== */
.app-header {
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-bottom: 1px solid rgba(79, 70, 229, 0.08);
  box-shadow: 0 10px 32px rgba(16, 24, 40, 0.06);
  padding: 14px 24px;
}

.app-header__inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-main {
  padding-top: 80px;
}

.app-footer {
  padding: 28px 24px 22px;
  background: #f5f6fb;
  color: #1f2a44;
  border-top: none;
}

.app-footer__surface {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px;
  border-radius: 36px;
  background: linear-gradient(135deg, #1da1f2 0%, #36b3ff 52%, #0f8bdc 100%);
  box-shadow: 0 24px 60px rgba(47, 43, 131, 0.18);
}

.app-footer__tagline,
.app-footer__col a {
  color: rgba(255,255,255,0.8);
}

.app-footer__col a:hover {
  color: #fff;
}

.app-footer__meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: rgba(255,255,255,0.86);
}

.app-footer__meta a {
  color: #fff;
  text-decoration: underline;
}

.app-footer__logo {
  width: 170px;
  margin-bottom: 16px;
  filter: brightness(0) invert(1);
}

.app-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.14);
}

.app-footer__right .btn--ghost {
  color: #fff;
  border-color: rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.08);
}

@media (max-width: 768px) {
  .app-header {
    padding: 12px 16px;
  }

  .app-header__actions {
    gap: 8px;
  }

  .app-header__actions .btn {
    padding: 10px 14px;
  }

  .app-footer {
    padding: 18px 16px 22px;
  }

  .app-footer__surface {
    padding: 22px;
    border-radius: 28px;
  }

  .app-footer__links {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .app-header__actions .btn {
    padding: 10px 12px;
    font-size: 14px;
  }

  .app-footer__links {
    grid-template-columns: 1fr;
  }
}

/* ==== Internal authenticated layout: no top header ==== */
#app.app--internal .app-header {
  display: none !important;
}

#app.app--internal .app-main {
  padding-top: 0 !important;
}

#app.app--internal .app-main--internal .app-sidebar {
  top: 0 !important;
}

#app.app--internal .app-main--internal .app-content {
  min-height: 100vh;
}

@media (max-width: 768px) {
  #app.app--internal .app-main {
    padding-top: 0 !important;
  }
}


/* FamilyDrivers: sidebar user name uses the same title gradient */
.sidebar-user__name {
  background: linear-gradient(90deg, #198FF2 0%, #000000 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
}
