/* Shared layout shell for role-based dashboards */

/* ── Sidebar transition (all breakpoints) ───────── */
.sidebar,
#sidebar {
  transition: transform 0.3s ease, box-shadow 0.2s ease;
}

/* ── Role-page dropdowns ─────────────────────────────────────────────
   Shared by Admin, Farmer, and Entrepreneur page content. Deliberately
   scoped below .main-content / #main-content main so navigation groups,
   sidebar flyouts, and the sidebar language popup keep their own design. */
.main-content .dropdown-menu,
#main-content main .dropdown-menu {
  z-index: 1060;
  min-width: 10rem;
  max-width: min(18rem, calc(100vw - 24px));
  max-height: min(18rem, 50vh);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #d6e8dc;
  border-radius: 12px;
  background: #fff;
  color: #1a2e22;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
  color-scheme: light;
}

.main-content .dropdown-menu .dropdown-item,
#main-content main .dropdown-menu .dropdown-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1a2e22;
  font-size: 14px;
  line-height: 1.25;
}

.main-content .dropdown-menu .dropdown-item:hover,
.main-content .dropdown-menu .dropdown-item:focus,
#main-content main .dropdown-menu .dropdown-item:hover,
#main-content main .dropdown-menu .dropdown-item:focus {
  background: #e8f5ed;
  color: #1e4d3a;
}

.main-content .dropdown-menu .dropdown-item.active,
.main-content .dropdown-menu .dropdown-item:active,
#main-content main .dropdown-menu .dropdown-item.active,
#main-content main .dropdown-menu .dropdown-item:active {
  background: #1e4d3a;
  color: #fff;
}

/* Bootstrap/Popper may flip menus above the trigger when space is tight.
   Role-page menus remain below and become internally scrollable instead. */
.main-content .dropdown > .dropdown-menu.show,
#main-content main .dropdown > .dropdown-menu.show {
  inset: calc(100% + 6px) auto auto 0 !important;
  transform: none !important;
  margin: 0 !important;
}

.main-content .dropdown > .dropdown-menu-end.show,
#main-content main .dropdown > .dropdown-menu-end.show {
  right: 0 !important;
  left: auto !important;
}

/* Native select popups are browser-owned, but supported browsers inherit
   these light option colours. This does not affect sidebar controls. */
.main-content select,
#main-content main select {
  color-scheme: light;
}
.main-content select option,
#main-content main select option {
  background: #fff;
  color: #1a2e22;
}
.main-content select option:checked,
#main-content main select option:checked {
  background: #1e4d3a;
  color: #fff;
}

.main-content .content-select,
#main-content main .content-select {
  position: relative;
  width: 220px;
  max-width: 100%;
}
.main-content .content-select-toggle,
#main-content main .content-select-toggle {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  text-align: left;
  white-space: nowrap;
}
.main-content .content-select-menu,
#main-content main .content-select-menu {
  width: max-content;
  min-width: 100%;
}
.main-content .content-select-menu .dropdown-item:disabled,
#main-content main .content-select-menu .dropdown-item:disabled {
  background: transparent;
  color: #9ca3af;
  opacity: 1;
}

@media (max-width: 576px) {
  .main-content .dropdown-menu,
  #main-content main .dropdown-menu {
    max-width: calc(100vw - 24px);
    max-height: min(15rem, 45vh);
  }
}

/* Portalled replacement for browser-native select popups. It lives under
   document.body, so it cannot inherit a card/table overflow clip. */
.role-select-menu {
  position: fixed;
  z-index: 2000;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #d6e8dc;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .22);
  color-scheme: light;
}
.role-select-option {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px 8px 8px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #1a2e22;
  font: 500 14px/1.25 'DM Sans', sans-serif;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
.role-select-check {
  width: 16px;
  flex: 0 0 16px;
  color: currentColor;
  font-weight: 700;
  text-align: center;
}
.role-select-option:hover,
.role-select-option:focus-visible {
  outline: none;
  background: #e8f5ed;
  color: #1e4d3a;
}
.role-select-option.active {
  background: #1e4d3a;
  color: #fff;
}
.role-select-option:disabled {
  background: #fff;
  color: #9ca3af;
  cursor: not-allowed;
}
.sidebar:hover,
#sidebar:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

/* ── Overlay (hidden by default) ────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1040;
  display: none;
}
.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ── Hamburger: hidden on desktop ───────────────── */
.mobile-menu-btn {
  display: none;
}

/* ── Notification bell: floats at the content's top-right corner, on the
   same line as the page title / action button (no reserved row). ──── */
.main-content,
#main-content main {
  position: relative;
}
.content-topbar {
  position: absolute;
  top: 26px;
  right: 28px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
@media (min-width: 992px) {
  .announcements-card {
    margin-top: 18px;
  }
}
/* Pages whose header has right-aligned content (Admin Products/Sales &
   Inventory buttons, Farmer Production "+ Add Record", Farmer/Entrepreneur
   Profile "Edit Profile", Farmer Income's month picker, dashboard welcome
   greetings) reserve room so that content sits just left of the bell
   instead of running under it. */
.si-page-header,
.prod-header,
.profile-header,
.income-header,
.dash-header,
.payroll-header,
.rep-topbar {
  padding-right: 58px;
}
/* Admin alone carries a second topbar button (Messages, which used to be a
   sidebar tab), so its pages need room for 42 + 10 + 42 + gutter instead of
   one button's 42. `.main-content` is the Admin shell's own class — Farmer
   and Entrepreneur use `#main-content` (see the .page-title note further
   down), so scoping here leaves their single-bell spacing untouched. */
.main-content .si-page-header,
.main-content .prod-header,
.main-content .profile-header,
.main-content .income-header,
.main-content .dash-header,
.main-content .payroll-header,
.main-content .rep-topbar {
  padding-right: 110px;
}
/* Only a banner placed immediately after the floating toolbar needs extra
   clearance from the toolbar's button row. Alerts that follow a page title
   or header already have that clearance; adding another 50px there creates
   an oversized title-to-message gap on every role and screen size. */
.main-content > .content-topbar + .alert,
#main-content main > .content-topbar + .alert {
  margin-top: 50px;
}
.notification-bell-btn,
.topbar-message-btn {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--border, #d8dfd9);
  background: #fff;
  color: var(--text-dark, #1e4d3a);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.notification-bell-btn:hover,
.topbar-message-btn:hover {
  background: #f4f7f5;
  border-color: var(--primary, #1e4d3a);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.notification-bell-btn i,
.topbar-message-btn i {
  font-size: 20px;
  pointer-events: none;
}
/* Unlike the bell (a <button>), this one is an Inertia <Link> — an anchor,
   which inherits the underline and link colour unless told otherwise. */
.topbar-message-btn {
  text-decoration: none;
}
/* Standing in for the "active" sidebar tab it replaced: while the messages
   page is open the button reads as selected rather than as one more idle
   icon. */
.topbar-message-btn.active,
.topbar-message-btn.active:hover {
  background: var(--primary, #1e4d3a);
  border-color: var(--primary, #1e4d3a);
  color: #fff;
}
.notification-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  border: 1.5px solid #fff;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
/* Dropdown is portalled to <body> and positioned via inline top/left. */
.notification-dropdown {
  position: fixed;
  overflow: hidden;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 40px -6px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
}
.notification-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}
.notification-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notification-header-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.notification-header-badge {
  background: #dcfce7;
  color: #166534;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.2;
}
.notification-mark-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--primary, #1e4d3a);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}
.notification-mark-all:hover {
  background: #f0fdf4;
  color: #14532d;
}
.notification-filter-panel {
  padding: 10px 14px;
  background: #fafbfa;
  border-bottom: 1px solid #eef2ef;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notification-status-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #e9eceb;
  padding: 3px;
  border-radius: 9px;
  gap: 3px;
}
.notification-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #526058;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.notification-tab-btn:hover {
  color: #1e2a22;
}
.notification-tab-btn.active {
  background: #ffffff;
  color: #1e4d3a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.notification-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dfe5e1;
  color: #43514a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.notification-tab-btn.active .notification-tab-badge {
  background: #e6f4ea;
  color: #166534;
}
.notification-tab-badge.unread-badge {
  background: #fee2e2;
  color: #b91c1c;
}
.notification-tab-btn.active .notification-tab-badge.unread-badge {
  background: #dc2626;
  color: #ffffff;
}
.notification-category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}
.notification-category-tabs::-webkit-scrollbar {
  display: none;
}
.notification-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  border: 1px solid #dbe2dd;
  border-radius: 999px;
  background: #ffffff;
  color: #4a5951;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.notification-chip-btn i {
  font-size: 11px;
  opacity: 0.85;
}
.notification-chip-btn:hover {
  background: #f3f6f4;
  border-color: #cbd7d0;
  color: #1e2a22;
}
.notification-chip-btn.active {
  background: #1e4d3a;
  border-color: #1e4d3a;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(30, 77, 58, 0.2);
}
.notification-chip-btn.active i {
  opacity: 1;
}
/* Backward compatibility for legacy tabs */
.notification-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.notification-tabs button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dark, #1e2a22);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
}
.notification-tabs button.active {
  background: #1e4d3a;
  color: #ffffff;
}
.notification-list {
  max-height: 350px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.notification-list::-webkit-scrollbar {
  width: 5px;
}
.notification-list::-webkit-scrollbar-thumb {
  background: #dbe2dd;
  border-radius: 999px;
}
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f4f2;
  cursor: pointer;
  background: #ffffff;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, border-left-color 0.15s ease;
  position: relative;
  text-align: left;
}
.notification-item:hover {
  background: #f8faf9;
}
.notification-item.unread {
  background: #f6fbf8;
  border-left-color: #16a34a;
}
.notification-item.unread:hover {
  background: #eef7f2;
}

.notification-item.current-status {
  border-left-color: #f59e0b;
  background: #fffcf3;
}

.notification-item.current-status:hover {
  background: #fff8e6;
}
.notification-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-top: 2px;
}
.notification-item-body {
  flex: 1;
  min-width: 0;
}
.notification-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  line-height: 1;
}
.notification-category-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: capitalize;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f0f3f1;
  color: #4a5951;
  letter-spacing: 0.02em;
}
.notification-category-badge.cat-production {
  background: #e6f4ea;
  color: #166534;
}
.notification-category-badge.cat-inventory {
  background: #fef3e0;
  color: #b45309;
}
.notification-category-badge.cat-trends {
  background: #e8f0fe;
  color: #1d4ed8;
}
.notification-category-badge.cat-inquiries {
  background: #fef3e0;
  color: #b45309;
}
.notification-item-time {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #7a8b81;
  font-weight: 500;
}
.notification-item-time i {
  font-size: 10px;
}
.notification-item-message {
  font-size: 13px;
  line-height: 1.45;
  color: #2b3930;
  word-break: break-word;
}
.notification-item.unread .notification-item-message {
  font-weight: 600;
  color: #0f1c14;
}
.notification-unread-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  margin-top: 6px;
  box-shadow: 0 0 0 2px #dcfce7;
}
.notification-empty {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.notification-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0f4f2;
  color: #5f7568;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 4px;
}
.notification-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #1e2a22;
}
.notification-empty-desc {
  font-size: 12px;
  color: #7a8b81;
  max-width: 250px;
  line-height: 1.4;
}
.notification-loading-spinner {
  font-size: 20px;
  color: var(--primary, #1e4d3a);
  animation: notifSpin 1s linear infinite;
  margin-bottom: 6px;
}
@keyframes notifSpin {
  100% { transform: rotate(360deg); }
}
.notification-dropdown-footer {
  padding: 9px 16px;
  border-top: 1px solid #f1f4f2;
  background: #fafbfa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #7a8b81;
  font-weight: 500;
}

/* Shared logout trigger for every role sidebar. */
.sidebar-footer .logout-link,
.sidebar-footer .nav-link.logout-link {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  margin: 2px 0 0;
  padding: 7px 0 7px 19px;
  border: 0;
  border-radius: 0;
  color: #b42318;
  background: transparent;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: color .16s ease, transform .16s ease;
}
.sidebar-footer .logout-link i,
.sidebar-footer .nav-link.logout-link i {
  color: #b42318;
  background: transparent;
  font-size: 17px;
  transition: color .16s ease;
}
.sidebar-footer .logout-link:hover,
.sidebar-footer .nav-link.logout-link:hover {
  color: #8f1d14;
  background: transparent;
  box-shadow: none;
  transform: translateX(3px);
}
.sidebar-footer .logout-link:hover i,
.sidebar-footer .nav-link.logout-link:hover i {
  color: #8f1d14;
  background: transparent;
}
.sidebar-footer .logout-link:focus-visible,
.sidebar-footer .nav-link.logout-link:focus-visible {
  outline: 3px solid rgba(180, 35, 24, .2);
  outline-offset: 2px;
}
.sidebar-footer .logout-link:active,
.sidebar-footer .nav-link.logout-link:active {
  transform: translateX(1px);
  box-shadow: none;
}

/* ── Shared pagination controls (Members/Products/Production) ──────── */
.pagination-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.pagination-bar button {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #d8dfd9);
  background: #fff;
  color: var(--text-dark, #1e2a22);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pagination-bar button:hover:not(:disabled) {
  background: #f4f7f5;
  border-color: var(--primary, #1e4d3a);
}
.pagination-bar button.active {
  background: var(--primary, #1e4d3a);
  border-color: var(--primary, #1e4d3a);
  color: #fff;
}
.pagination-bar button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-info {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted, #8a9a90);
}
.pagination-ellipsis {
  padding: 0 4px;
  color: var(--text-muted, #8a9a90);
  font-size: 13px;
}

/* ================================================
   MOBILE / TABLET  (≤ 991px)
   – Fixed top bar: page title (left) + hamburger (right)
   – Sidebar slides in from the RIGHT
================================================ */
@media (max-width: 991px) {

  /* ── Page title becomes the fixed top bar ──────── */
  .page-title {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1025;
    margin: 0;
    padding: 0 72px 0 20px;
    height: 60px;
    line-height: 60px;
    background: var(--primary);
    color: #fff;
    font-size: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: none;
  }

  /* The rule above is unscoped (0,1,0), but the role stylesheets scope
     their own .page-title more tightly — admin.css's
     `.main-content .page-title` (dark green text, for the desktop
     heading) and farmer.css's `.income-page .page-title` (32px).
     Specificity beats load order, so on phones those kept winning and
     the title painted dark-on-dark inside the green bar, effectively
     unreadable. Restate the bar's own colour and size at matching
     weight: `#main-content` (id) covers Farmer/Entrepreneur including
     .income-page, `.main-content` (class) covers Admin, and role-shell
     loads after both. */
  .main-content .page-title,
  #main-content .page-title {
    color: #fff;
    font-size: 20px;
  }

  /* Admin's bar carries hamburger + bell + message button. The left edge of
     the message button sits 154px from the right (110px offset + 44px
     width), so leave that entire action rail plus a small visual gap free.
     The previous 118px reservation only cleared the buttons' offsets, not
     their widths, which let long titles paint underneath the message icon. */
  .main-content .page-title {
    padding-right: 164px;
    font-size: clamp(17px, 4.6vw, 20px);
  }

  /* ── Hamburger: white icon, right side of the bar ─ */
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 8px;
    right: 12px;
    z-index: 1030;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    margin: 0;
  }
  .mobile-menu-btn:hover {
    background: rgba(255,255,255,0.12);
  }

  .mobile-menu-btn i {
    font-size: 30px;
    pointer-events: none;
  }

  /* ── Notification bell: move into the fixed top bar, left of hamburger ──
     display:contents drops this wrapper's own box from the tree. Without
     it, the wrapper is a zero-height flex item (its only child, the bell,
     is position:fixed and so contributes no content) nested inside
     .main-content's column flex layout — and mobile Chromium/WebKit
     silently fail to paint a fixed-position descendant of a collapsed
     flex item, so the bell never appeared on phones at all. */
  .content-topbar {
    display: contents;
    position: static;
    min-height: 0;
    margin: 0;
  }
  .si-page-header,
  .prod-header,
  .profile-header,
  .income-header,
  .dash-header,
  .payroll-header,
  .rep-topbar,
  /* The desktop Admin reservation above is (0,2,0); these bare classes are
     (0,1,0), so without restating them at matching weight the 110px gutter
     would survive into the phone layout where the buttons have left the
     content flow entirely. */
  .main-content .si-page-header,
  .main-content .prod-header,
  .main-content .profile-header,
  .main-content .income-header,
  .main-content .dash-header,
  .main-content .payroll-header,
  .main-content .rep-topbar {
    padding-right: 0;
  }
  .notification-bell-btn,
  .topbar-message-btn {
    position: fixed;
    top: 8px;
    right: 58px;
    z-index: 1031;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #fff;
    box-shadow: none;
  }
  /* Third in the row: hamburger 12–56, bell 58–102, message 104–148. */
  .topbar-message-btn {
    right: 104px;
  }
  .notification-bell-btn:hover,
  .topbar-message-btn:hover {
    background: rgba(255,255,255,0.12);
    box-shadow: none;
  }
  .notification-bell-btn i,
  .topbar-message-btn i {
    font-size: 24px;
  }
  /* The desktop "active" pill would paint a dark green box inside the dark
     green bar. In the bar, being on the page is already obvious from the
     title, so the button just stays white like its neighbours. */
  .topbar-message-btn.active,
  .topbar-message-btn.active:hover {
    background: transparent;
    color: #fff;
  }
  /* The badge is offset from the *button's* 44x44 box (top:-5/right:-5 in
     the base rule), which reads fine on desktop where the button has a
     visible bordered card giving that corner context. Mobile's button has
     no border, so the badge — parked at the invisible box's corner while
     the bell glyph sits centered well inside it — reads as floating off
     on its own. Pull it in to sit against the glyph itself instead. */
  .notification-badge {
    top: 3px;
    right: 6px;
  }
  /* Keep the dropdown within the viewport on phones. */
  .notification-dropdown {
    max-width: calc(100vw - 16px);
  }

  /* ── Sidebar — right drawer ─────────────────────── */
  .sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    height: 100vh;
    transform: translateX(100%);
    z-index: 1050;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  /* ── Overlay ─────────────────────────────────────── */
  .sidebar-overlay {
    display: block;
  }

  /* ── Main content: full width, pad top for header bar */
  .main-content,
  #main-content {
    margin-left: 0 !important;
    padding-top: 70px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 24px !important;
  }

  .main-content.has-mobile-fab,
  .main-content:has(.mobile-add-fab),
  .main-content:has(.ra-floating-add),
  .main-content:has(.mobile-add-menu),
  #main-content.has-mobile-fab,
  #main-content:has(.mobile-add-fab),
  #main-content:has(.ra-floating-add),
  #main-content:has(.mobile-add-menu) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important;
  }

  main {
    padding: 0 !important;
  }

  .page-sub {
    margin-bottom: 14px;
  }

}
