/* ─── App Shell Layout (Odoo Enterprise Mobile) ─── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ─── Header Bar (Odoo-style top bar) ─── */
.header-bar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--o-brand-primary);
  color: #fff;
  z-index: var(--z-header);
}
.header-bar__inner {
  display: flex; align-items: center; gap: var(--space-sm);
  height: 100%; padding: 0 var(--space-sm);
}
.header-bar__menu-btn {
  color: #fff; padding: var(--space-xs);
  border-radius: var(--radius-md);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.header-bar__menu-btn:active { opacity: 0.7; }
.header-bar__title {
  flex: 1; font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.header-bar__actions {
  display: flex; align-items: center; gap: var(--space-xs);
}
.header-bar__sync {
  color: #fff; padding: var(--space-xs);
  display: flex; align-items: center; gap: var(--space-xs);
  width: 36px; height: 36px; justify-content: center;
}

/* ─── Bottom Navigation (Odoo mobile-style bottom tabs) ─── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: var(--z-bottom-nav);
  display: flex; align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav__item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px; padding: var(--space-xs) 0;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav__item:active {
  background: var(--color-primary-bg);
}
.bottom-nav__item--active {
  color: var(--o-brand-primary);
}
.bottom-nav__item--active::after {
  content: '';
  position: absolute; top: 0; left: 25%; right: 25%;
  height: 2px;
  background: var(--o-brand-primary);
  border-radius: 0 0 2px 2px;
}
.bottom-nav__icon {
  width: 22px; height: 22px;
}
.bottom-nav__label {
  font-size: 10px; line-height: 1;
  letter-spacing: 0.01em;
}
.bottom-nav__badge {
  position: absolute; top: 2px; right: calc(50% - 18px);
  background: var(--color-danger);
  color: #fff; font-size: 9px; font-weight: var(--font-weight-bold);
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ─── Nav Drawer (for More menu / desktop) ─── */
.nav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--nav-width); background: var(--color-surface);
  z-index: var(--z-nav); transform: translateX(-100%);
  transition: transform var(--transition-base);
  overflow-y: auto;
}
.nav-drawer--open { transform: translateX(0); }
.nav-drawer__inner { display: flex; flex-direction: column; height: 100%; }
.nav-drawer__header {
  padding: var(--space-lg) var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  margin-top: var(--header-height);
  background: var(--color-primary-bg);
}
.nav-drawer__instance { display: flex; flex-direction: column; gap: var(--space-xs); }
.nav-drawer__instance strong { font-size: var(--font-size-base); color: var(--color-text); }
.nav-drawer__instance small { color: var(--color-text-muted); font-size: var(--font-size-xs); }
.nav-drawer__links { flex: 1; padding: var(--space-xs) 0; }
.nav-drawer__link {
  display: flex; align-items: center; gap: var(--space-md);
  padding: 10px var(--space-md);
  color: var(--color-text-secondary); font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  transition: all var(--transition-fast);
}
.nav-drawer__link:hover { background: var(--color-primary-bg); color: var(--color-text); }
.nav-drawer__link--active {
  color: var(--o-brand-primary); background: var(--color-primary-bg);
  font-weight: var(--font-weight-medium);
}
.nav-drawer__icon { flex-shrink: 0; opacity: 0.7; }
.nav-drawer__link--active .nav-drawer__icon { opacity: 1; }
.nav-drawer__divider { height: 1px; background: var(--color-border-light); margin: var(--space-xs) var(--space-md); }
.nav-drawer__footer {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

/* ─── Nav Overlay ─── */
.nav-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: calc(var(--z-nav) - 1);
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition-base);
}
.nav-overlay--visible { opacity: 1; pointer-events: auto; }

/* ─── Main Content ─── */
.content {
  margin-top: var(--header-height);
  margin-bottom: var(--bottom-nav-height);
  padding: var(--space-md);
  flex: 1;
  max-width: var(--content-max-width);
  width: 100%;
  margin-left: auto; margin-right: auto;
}

/* ─── Offline Banner ─── */
.offline-banner {
  position: fixed; top: var(--header-height); left: 0; right: 0;
  background: var(--color-warning); color: var(--color-gray-800);
  padding: var(--space-xs) var(--space-md);
  text-align: center; font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  z-index: calc(var(--z-header) - 1);
  display: flex; align-items: center; justify-content: center;
}

/* ─── Login Screen (Odoo Enterprise) ─── */
.login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh; padding: var(--space-md);
  background: var(--o-brand-primary);
}
.login-card {
  background: var(--color-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); padding: var(--space-xl);
  width: 100%; max-width: 380px;
}
.login-card__logo {
  text-align: center; margin-bottom: var(--space-lg);
  color: var(--o-brand-primary); font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
}
.login-card__error {
  background: var(--color-danger-light); color: var(--color-danger);
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm);
  margin-bottom: var(--space-md); font-size: var(--font-size-sm);
}

/* ─── Desktop layout ─── */
@media (min-width: 769px) {
  .bottom-nav { display: none; }
  .nav-drawer {
    transform: translateX(0); border-right: 1px solid var(--color-border);
    box-shadow: none;
  }
  .nav-overlay { display: none; }
  .header-bar { left: var(--nav-width); }
  .header-bar__menu-btn { display: none; }
  .content { margin-left: var(--nav-width); margin-bottom: 0; }
  .offline-banner { left: var(--nav-width); }
}

/* ─── Helper Classes ─── */
.page-title {
  font-size: var(--font-size-xl); font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md); color: var(--color-text);
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-md); flex-wrap: wrap; gap: var(--space-sm);
}
.section-title {
  font-size: var(--font-size-xs); font-weight: var(--font-weight-semibold);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin: var(--space-lg) 0 var(--space-sm); color: var(--color-text-muted);
}
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); font-size: var(--font-size-sm); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }

/* Detail views */
.detail-header {
  display: flex; align-items: center; gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.detail-header__title {
  flex: 1; display: flex; align-items: center; gap: var(--space-sm);
}
.detail-fields { display: flex; flex-direction: column; }
.detail-field {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.detail-field:last-child { border-bottom: none; }
.detail-field label {
  color: var(--color-text-secondary); font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
}
.detail-field span { font-weight: var(--font-weight-medium); }
.detail-field a { color: var(--o-brand-primary); }
.detail-actions {
  display: flex; gap: var(--space-sm); margin-top: var(--space-lg); flex-wrap: wrap;
}
