/* ==========================================================================
   APP.CSS — Functional screens (mobile-first)
   ==========================================================================
   Used by authenticated/functional pages: dashboard, lists, search, etc.
   All rules are mobile-first: base = phone, then @media (min-width) for larger.
   ========================================================================== */

/* --- Badges & tags --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge--green  { background: var(--green-light); color: var(--green); }
.badge--red    { background: #fef2f2; color: #e53e3e; }
.badge--blue   { background: #dbeafe; color: #2563eb; }
.badge--grey   { background: var(--off-white); color: var(--grey-500); }
.badge--orange { background: var(--orange-light); color: var(--orange); }
.badge--warn   { background: #FEF3C7; color: #92400E; }

/* --- Tab bar --- */
.tab-bar {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--grey-100);
}
.tab-bar__item {
  flex: 1;
  padding: 12px 8px;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  color: var(--grey-500);
  border: none;
  background: none;
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition);
}
.tab-bar__item:hover { color: var(--anthracite); }
.tab-bar__item--active {
  color: var(--green);
  border-bottom: 2px solid var(--green);
  margin-bottom: -2px;
}

/* --- Action button (small) --- */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--grey-700);
  background: none;
  border: 1px solid var(--grey-200, #e2e5ed);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.action-btn:hover {
  border-color: var(--anthracite);
  color: var(--anthracite);
}
.action-btn--danger {
  color: #e53e3e;
  border-color: #fca5a5;
}
.action-btn--danger:hover {
  background: #fef2f2;
  border-color: #e53e3e;
}
.action-btn--confirm {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
  font-weight: 600;
}
.action-btn--confirm:hover {
  background: #4e9446;
}

/* --- Table wrapper (horizontal scroll on mobile) --- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px;
  padding: 0 16px;
}

@media (min-width: 600px) {
  .table-wrap { margin: 0; padding: 0; }
}

/* --- Mobile auth navigation (logged-in user links in mobile menu) --- */
.nav-mobile-divider {
  height: 1px;
  background: var(--grey-100);
  margin: 8px 0;
}

/* --- Notification bell --- */
.notif-bell {
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-bell__icon {
  font-size: 1.2rem;
  color: var(--grey-700);
  transition: color var(--transition);
}
.notif-bell:hover .notif-bell__icon { color: var(--anthracite); }
.notif-bell__badge {
  position: absolute;
  top: 2px;
  right: 0;
  background: #e53e3e;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.notif-bell__badge:empty,
.notif-bell__badge[data-count="0"] { display: none; }

/* --- Notification dropdown --- */
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-width: 90vw;
  max-height: 400px;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--grey-100);
  z-index: 200;
}
.notif-dropdown--open { display: block; }
.notif-dropdown__empty {
  padding: 24px;
  text-align: center;
  color: var(--grey-500);
  font-size: .875rem;
}
.notif-dropdown__item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--grey-100);
  text-decoration: none;
  color: var(--anthracite);
  transition: background var(--transition);
}
.notif-dropdown__item:hover { background: var(--off-white); }
.notif-dropdown__item--unread { background: var(--sky-light); }
.notif-dropdown__item--unread:hover { background: #dbeafe; }
.notif-dropdown__title {
  font-weight: 600;
  font-size: .875rem;
  margin-bottom: 2px;
}
.notif-dropdown__message {
  font-size: .8rem;
  color: var(--grey-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.notif-dropdown__time {
  font-size: .7rem;
  color: var(--grey-400);
  margin-top: 4px;
}
.notif-dropdown__footer {
  padding: 10px 16px;
  text-align: center;
  font-size: .8rem;
  font-weight: 600;
  color: var(--sky);
  cursor: pointer;
  border-top: 1px solid var(--grey-100);
}
.notif-dropdown__footer:hover { background: var(--off-white); }

