/**
 * ERPAL ONE bottom app bar — isolated stylesheet.
 *
 * Mobile (<=820px): fixed full-width thumb-first bar, milestrong-style.
 * Desktop (>820px): centered floating pill (max-width 480px, bottom 16px).
 * All colors come from the shared --erpal-* custom properties (with
 * fallbacks) so dark mode inherits automatically. Raw hex appears ONLY as
 * var() fallbacks.
 */

:root {
  --erpal-appbar-h: 60px;
}

/* Never overlap content: reserve the bar's height below the page. */
body {
  padding-bottom: calc(var(--erpal-appbar-h) + 12px);
}

/* ------------------------------ Bar shell ------------------------------ */
.erpal-appbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--erpal-appbar-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  background: var(--erpal-surface, #ffffff);
  border-top: 1px solid var(--erpal-line, #e6e9ee);
  box-shadow: 0 -2px 12px rgba(20, 33, 61, .08);
  z-index: 60; /* above sidebar (50) and topbar (40) */
}

/* ------------------------------ Nav slots ------------------------------ */
.erpal-appbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--erpal-ink-soft, #5f6b7a);
}
.erpal-appbar__item svg {
  width: 22px;
  height: 22px;
}
.erpal-appbar__label {
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .2px;
}
.erpal-appbar__item:hover {
  color: var(--erpal-ink, #1f2733);
}
.erpal-appbar__item.is-active {
  color: var(--erpal-brand, #1a73e8);
}

/* ------------------------- Center "+ New" FAB -------------------------- */
.erpal-appbar__fabwrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
}
.erpal-appbar__fab {
  width: 48px;
  height: 48px;
  margin-top: -26px; /* raised above the bar edge */
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--erpal-brand, #1a73e8);
  color: var(--erpal-surface, #ffffff);
  box-shadow: var(--erpal-shadow-lg, 0 4px 16px rgba(20, 33, 61, .10));
  transition: background .15s ease, transform .15s ease;
}
.erpal-appbar__fab svg {
  width: 22px;
  height: 22px;
}
.erpal-appbar__fab:hover {
  background: var(--erpal-brand-dark, #1559b8);
}
.erpal-appbar__fabwrap.is-open .erpal-appbar__fab {
  transform: rotate(45deg);
}
.erpal-appbar__label--fab {
  margin-top: 2px;
  color: var(--erpal-ink-soft, #5f6b7a);
}

/* --------------------- Quick-create menu (opens UP) -------------------- */
.erpal-appbar__menu {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 172px;
  display: none;
  flex-direction: column;
  padding: 6px;
  background: var(--erpal-surface, #ffffff);
  border: 1px solid var(--erpal-line, #e6e9ee);
  border-radius: var(--erpal-radius, 8px);
  box-shadow: var(--erpal-shadow-lg, 0 4px 16px rgba(20, 33, 61, .10));
}
.erpal-appbar__fabwrap.is-open .erpal-appbar__menu {
  display: flex;
}
.erpal-appbar__menu a {
  padding: 9px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 600;
  color: var(--erpal-ink, #1f2733);
}
.erpal-appbar__menu a:hover {
  background: var(--erpal-brand-soft, #e8f0fe);
  color: var(--erpal-brand, #1a73e8);
}

/* -------------------- Desktop: centered floating pill ------------------ */
@media (min-width: 821px) {
  .erpal-appbar {
    left: 50%;
    right: auto;
    bottom: 16px;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 480px;
    border: 1px solid var(--erpal-line, #e6e9ee);
    border-radius: 32px;
    box-shadow: var(--erpal-shadow-lg, 0 4px 16px rgba(20, 33, 61, .10));
  }
  body {
    padding-bottom: calc(var(--erpal-appbar-h) + 32px);
  }
}
