/* ── Global UX enhancements ── */

html {
  scroll-behavior: smooth;
}

body.g-sidenav-show {
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Unified scrollbar styling */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 120, 216, 0.45) rgba(15, 23, 42, 0.06);
}

/* ── Sidebar: full readable labels on every breakpoint ── */

:root {
  --ag-sidebar-width: 17.5rem;
  --ag-sidebar-gap: 1.25rem;
}

/* Kill Argon mini / hidden sidenav modes — always show full labels */
body.g-sidenav-show #sidenav-main.sidenav,
body.g-sidenav-show .navbar-vertical.navbar-expand-xs,
#sidenav-main.sidenav.ag-sidebar {
  width: var(--ag-sidebar-width) !important;
  min-width: var(--ag-sidebar-width) !important;
  max-width: var(--ag-sidebar-width) !important;
}

@media (min-width: 1200px) {
  body.g-sidenav-show #sidenav-main.sidenav,
  #sidenav-main.sidenav.ag-sidebar {
    left: var(--ag-sidebar-gap) !important;
    margin-left: 0 !important;
  }

  body.g-sidenav-show .sidenav.fixed-start + .main-content,
  body.g-sidenav-show #sidenav-main + .main-content,
  .ag-shell-main.main-content {
    margin-left: calc(var(--ag-sidebar-width) + var(--ag-sidebar-gap) + 0.75rem) !important;
  }

  /* Never collapse to icon-only width */
  .g-sidenav-hidden .navbar-vertical,
  body.g-sidenav-hidden .navbar-vertical {
    max-width: var(--ag-sidebar-width) !important;
    width: var(--ag-sidebar-width) !important;
  }

  .g-sidenav-hidden .navbar-vertical .nav-item .nav-link .nav-link-text,
  .g-sidenav-hidden .navbar-vertical .nav-item .nav-link .sidenav-normal {
    opacity: 1 !important;
    width: auto !important;
    max-width: none !important;
  }
}

#sidenav-main {
  display: flex !important;
  flex-direction: column !important;
  top: 1rem !important;
  bottom: 1rem !important;
  /* Fixed height so footer never clips past overflow:hidden */
  height: calc(100vh - 2rem) !important;
  height: calc(100dvh - 2rem) !important;
  max-height: calc(100vh - 2rem) !important;
  max-height: calc(100dvh - 2rem) !important;
  overflow: hidden !important;
  z-index: 1050;
  padding: 0.35rem 0 0.5rem !important;
}

#sidenav-main .sidenav-header {
  flex-shrink: 0;
  height: auto !important;
  min-height: 4.25rem;
  padding: 0.35rem 0.85rem 0.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#sidenav-main .navbar-brand {
  width: 100%;
  padding: 0.5rem 0.65rem !important;
  margin: 0 !important;
}

#sidenav-main .navbar-brand-img {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  max-height: 3.25rem !important;
  object-fit: contain;
}

#sidenav-main .navbar-collapse,
.navbar-vertical.navbar-expand-xs .navbar-collapse {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 0.15rem 0.55rem 0.5rem !important;
}

#sidenav-main .sidenav-footer {
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  margin-top: auto !important;
  padding: 0.75rem 1rem 1.15rem !important;
  overflow: visible !important;
  display: block !important;
  visibility: visible !important;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  background: #fff;
}

#sidenav-main .ag-logout-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100% !important;
  min-height: 2.5rem;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0.85rem;
  white-space: nowrap;
  visibility: visible !important;
  opacity: 1 !important;
}

#sidenav-main .navbar-nav {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

#sidenav-main .nav-item {
  width: 100% !important;
  margin: 0 !important;
}

#sidenav-main .nav-link,
#sidenav-main .ag-nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 0.7rem !important;
  width: auto !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0.65rem 0.75rem !important;
  border-radius: 0.9rem !important;
  white-space: nowrap;
  overflow: visible !important;
}

#sidenav-main .nav-link .icon,
#sidenav-main .ag-nav-link .icon {
  flex: 0 0 2rem !important;
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem !important;
  margin: 0 !important;
}

#sidenav-main .nav-link-text,
#sidenav-main .ag-nav-link .nav-link-text {
  flex: 1 1 auto !important;
  flex-shrink: 1 !important;
  min-width: 7.5rem !important;
  max-width: none !important;
  width: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: normal !important;
  line-height: 1.3 !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #344767 !important;
  margin: 0 !important;
  pointer-events: none;
}

#sidenav-main .nav-link.active .nav-link-text,
#sidenav-main .ag-nav-link.active .nav-link-text {
  color: #4054c4 !important;
}

#sidenav-main .ag-sidebar__section-label {
  padding-left: 0.85rem !important;
  margin: 0.85rem 0 0.35rem !important;
  letter-spacing: 0.06em;
  font-size: 0.65rem !important;
  color: #8b98ad;
}

/* Mobile drawer close — same edge-mounted dark chevron language as desktop */
@media (max-width: 1199.98px) {
  #sidenav-main.sidenav.ag-sidebar,
  #sidenav-main.sidenav.ag-sidebar.navbar-vertical.navbar-expand-xs {
    overflow: visible !important;
  }

  #sidenav-main.ag-sidebar .navbar-collapse,
  #sidenav-main.ag-sidebar #sidenav-collapse-main {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #sidenav-main.ag-sidebar .sidenav-footer {
    overflow: hidden;
  }

  .ag-sidebar__close {
    position: absolute;
    top: 1.35rem;
    right: -0.85rem;
    z-index: 40;
    width: 1.7rem;
    height: 1.7rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #0f172a;
    color: #f8fafc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
      box-shadow 0.15s ease, transform 0.15s ease;
  }

  .ag-sidebar__close i {
    font-size: 0.58rem;
    opacity: 1 !important;
    line-height: 1;
  }

  .ag-sidebar__close:hover,
  .ag-sidebar__close:focus-visible {
    background: #071e4f;
    border-color: #071e4f;
    color: #ffffff;
    outline: none;
    box-shadow: 0 6px 16px rgba(7, 30, 79, 0.35);
  }

  .ag-sidebar__close:active {
    transform: scale(0.94);
  }
}

.ag-sidebar {
  border-radius: 1.5rem !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%) !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12) !important;
}

/* Mobile sidebar overlay */
.ag-sidenav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.g-sidenav-pinned .ag-sidenav-backdrop,
.ag-sidenav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1050;
}

@media (min-width: 1200px) {
  .ag-sidenav-backdrop {
    display: none !important;
  }
}

/* Tablet / mobile: off-canvas drawer with full labels */
@media (max-width: 1199.98px) {
  :root {
    --ag-sidebar-width: min(19rem, 88vw);
  }

  #sidenav-main.sidenav,
  .g-sidenav-show:not(.rtl) #sidenav-main.sidenav,
  body.g-sidenav-show #sidenav-main.sidenav.ag-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    margin: 0 !important;
    width: var(--ag-sidebar-width) !important;
    min-width: min(19rem, 88vw) !important;
    max-width: min(19rem, 88vw) !important;
    max-height: 100dvh !important;
    height: 100dvh !important;
    border-radius: 0 1.25rem 1.25rem 0 !important;
    transform: translateX(-110%) !important;
    transition: transform 0.28s ease !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    z-index: 1056 !important;
  }

  body.g-sidenav-pinned #sidenav-main.sidenav.ag-sidebar,
  body.g-sidenav-show.g-sidenav-pinned #sidenav-main.sidenav.ag-sidebar,
  body.g-sidenav-show #sidenav-main.sidenav.ag-sidebar.is-open,
  #sidenav-main.ag-sidebar.is-open {
    transform: translateX(0) !important;
  }

  .ag-shell-main,
  .sidenav.fixed-start + .main-content,
  body.g-sidenav-show .sidenav.fixed-start + .main-content,
  .ag-shell-main.main-content {
    margin-left: 0 !important;
    padding-inline: 0.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .ag-page-content {
    padding: 0.85rem 0.5rem 1.75rem !important;
  }

  #sidenav-main .nav-link-text {
    white-space: nowrap !important;
  }
}

@media (max-width: 575.98px) {
  :root {
    --ag-sidebar-width: min(18rem, 92vw);
  }

  #sidenav-main.sidenav,
  body.g-sidenav-show #sidenav-main.sidenav.ag-sidebar {
    width: var(--ag-sidebar-width) !important;
    min-width: min(18rem, 92vw) !important;
    max-width: min(18rem, 92vw) !important;
  }

  #sidenav-main .nav-link,
  #sidenav-main .ag-nav-link {
    padding: 0.7rem 0.8rem !important;
  }

  #sidenav-main .nav-link-text {
    font-size: 0.9rem !important;
  }
}

/* Topbar layout */
.ag-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.ag-topbar__left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 auto;
}

.ag-topbar__breadcrumb {
  min-width: 0;
}

.ag-topbar__title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 16rem);
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
}

.ag-topbar__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin: 0;
}

.ag-menu-btn {
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.14);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@media (max-width: 1199.98px) {
  .ag-menu-btn {
    display: inline-flex !important;
  }
}

.ag-menu-btn:hover,
.ag-menu-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  outline: none;
}

.ag-user-chip,
.ag-user-chip--btn {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ag-user-chip--btn {
  appearance: none;
  font: inherit;
}

.ag-user-chip:hover,
.ag-user-chip--btn:hover,
.ag-user-chip:focus-visible,
.ag-user-chip--btn:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}

.ag-user-chip__caret {
  font-size: 0.65rem;
  opacity: 0.85;
}

.ag-topbar__right .nav-item {
  position: relative;
  list-style: none;
}

.ag-profile-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 1080;
  min-width: 14rem;
  padding: 0.4rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  animation: ag-menu-pop 0.18s ease;
}

@keyframes ag-menu-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ag-profile-menu__head {
  padding: 0.65rem 0.75rem 0.55rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  margin-bottom: 0.25rem;
}

.ag-profile-menu__head strong {
  display: block;
  color: #102a43;
  font-size: 0.9rem;
}

.ag-profile-menu__item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: #344767 !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
}

.ag-profile-menu__item:hover {
  background: rgba(27, 120, 216, 0.08);
  color: #4054c4 !important;
}

.ag-profile-menu__item--danger {
  color: #b91c1c !important;
}

.ag-profile-menu__item--danger:hover {
  background: rgba(185, 28, 28, 0.08);
  color: #991b1b !important;
}

/* Full-cover auth splash — blocks unfinished UI flash on refresh */
.ag-auth-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: linear-gradient(160deg, #e8f3fc 0%, #f8fafc 45%, #e8f4f8 100%);
  color: #475569;
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}

.ag-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(27, 120, 216, 0.2);
  border-top-color: #1b78d8;
  border-radius: 50%;
  animation: ag-spin 0.7s linear infinite;
}

@keyframes ag-spin {
  to {
    transform: rotate(360deg);
  }
}

.ag-menu-btn .sidenav-toggler-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ag-menu-btn .sidenav-toggler-line {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
}

@media (max-width: 575.98px) {
  .ag-topbar {
    margin-inline: 0.35rem !important;
    top: 0.35rem !important;
  }

  .ag-user-chip {
    padding: 0.4rem 0.55rem;
    gap: 0;
  }

  .ag-shell-main {
    padding-inline: 0.25rem !important;
  }
}

/* Topbar scroll shadow */
.ag-topbar.ag-topbar--scrolled {
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

/* Soft page entrance — avoid jarring blink on refresh */
.ag-page-content {
  animation: none;
}

@media (prefers-reduced-motion: no-preference) {
  .ag-page-content {
    animation: ag-fade-in 0.18s ease;
  }
}

@keyframes ag-fade-in {
  from {
    opacity: 0.92;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page header */
.ag-page-header {
  margin-bottom: 1.5rem;
}

.ag-page-header__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(27, 120, 216, 0.1);
  color: #4054c4;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.ag-page-header__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 700;
  color: var(--ag-text);
  line-height: 1.2;
}

.ag-page-header__subtitle {
  margin: 0.4rem 0 0;
  color: var(--ag-text-muted);
  font-size: 0.95rem;
  max-width: 42rem;
}

/* Stat cards */
.ag-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ag-stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.98));
  border: 1px solid var(--ag-border);
  border-radius: 1.25rem;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--ag-shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ag-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.1);
}

.ag-stat-card__label {
  margin: 0 0 0.35rem;
  color: var(--ag-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ag-stat-card__value {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  font-weight: 700;
  color: var(--ag-text);
  line-height: 1.2;
}

.ag-stat-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(27, 120, 216, 0.14), rgba(17, 205, 239, 0.1));
  color: #1b78d8;
  margin-bottom: 0.65rem;
  font-size: 1rem;
}

/* Horizontal scroll row with fade hint */
.ag-scroll-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.ag-scroll-row > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
  min-width: min(280px, 85vw);
}

.ag-scroll-hint {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ag-text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.65rem;
}

@media (min-width: 1200px) {
  .ag-scroll-hint {
    display: none;
  }
}

/* Property card hover */
.ag-property-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  border-radius: 1rem !important;
}

.ag-property-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(27, 120, 216, 0.14) !important;
  border-color: rgba(27, 120, 216, 0.28) !important;
}

/* Interactive table rows */
.ag-table-row-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.ag-table-row-clickable:hover {
  background-color: rgba(27, 120, 216, 0.05) !important;
}

.ag-table-row-clickable:active {
  background-color: rgba(27, 120, 216, 0.09) !important;
}

/* Scrollable table region */
.ag-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  width: 100%;
}

.ag-table-scroll table {
  min-width: 640px;
}

/* Mobile card list for tables */
.ag-mobile-cards {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
}

.ag-mobile-card {
  background: #fff;
  border: 1px solid var(--ag-border, rgba(15, 23, 42, 0.08));
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ag-mobile-card:active {
  border-color: rgba(27, 120, 216, 0.35);
  box-shadow: 0 12px 28px rgba(27, 120, 216, 0.12);
}

.ag-mobile-card__title {
  font-weight: 700;
  color: #102a43;
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
  line-height: 1.35;
}

.ag-mobile-card__row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.28rem 0;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
  font-size: 0.82rem;
}

.ag-mobile-card__label {
  color: #6b7a90;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: capitalize;
}

.ag-mobile-card__value {
  color: #102a43;
  text-align: right;
  word-break: break-word;
  min-width: 0;
}

@media (max-width: 767.98px) {
  .ag-table-desktop {
    display: none !important;
  }

  .ag-mobile-cards {
    display: flex;
  }

  .ag-table-shell {
    overflow: visible !important;
  }

  .ag-table-toolbar__filters > div .form-select {
    width: 100% !important;
    min-width: 0 !important;
  }

  .ag-table-toolbar__filters {
    width: 100%;
  }

  .ag-table-toolbar__filters > * {
    width: 100%;
  }
}

@media (min-width: 768px) {
  .ag-mobile-cards {
    display: none !important;
  }
}

/* Profile completion banner */
.ag-profile-banner {
  margin: 0.75rem 0.75rem 0;
  border-radius: 1.15rem;
  border: 1px solid #eee;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  padding: 1rem;
  overflow: hidden;
}

.ag-profile-banner__layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
}

.ag-profile-banner__ring {
  flex-shrink: 0;
}

.ag-profile-banner__body {
  flex: 1 1 220px;
  min-width: 0;
}

.ag-profile-banner__actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.ag-profile-banner__verify {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border-radius: 0.85rem;
  background: #fff8e1;
  border: 1px solid #ffe0b2;
}

@media (max-width: 767.98px) {
  .ag-profile-banner {
    margin: 0.65rem 0.35rem 0;
    padding: 0.85rem;
  }

  .ag-profile-banner__layout {
    flex-direction: column;
    align-items: stretch;
  }

  .ag-profile-banner__actions {
    margin-left: 0;
    width: 100%;
  }

  .ag-profile-banner__actions .btn {
    width: 100%;
  }

  .ag-profile-banner__verify ol {
    padding-left: 1.1rem;
  }
}

/* Upcoming jobs list */
.ag-upcoming-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ag-upcoming-item__meta {
  flex: 1 1 180px;
  min-width: 0;
}

.ag-upcoming-item__action {
  flex-shrink: 0;
}

@media (max-width: 575.98px) {
  .ag-upcoming-item {
    flex-direction: column;
    align-items: stretch;
  }

  .ag-upcoming-item__action,
  .ag-upcoming-item__action .btn {
    width: 100%;
  }
}

/* Compact pagination */
.ag-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--ag-border);
}

.ag-pagination__info {
  color: var(--ag-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.ag-pagination__controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.ag-pagination__btn {
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(27, 120, 216, 0.2);
  background: #fff;
  color: #1b78d8;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.ag-pagination__btn:hover:not(:disabled) {
  background: rgba(27, 120, 216, 0.08);
  border-color: rgba(27, 120, 216, 0.35);
}

.ag-pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ag-pagination__btn.is-active {
  background: linear-gradient(135deg, #1b78d8, #4fb6ff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(27, 120, 216, 0.3);
}

.ag-pagination__btn--jump {
  min-width: 2.5rem;
  font-variant-numeric: tabular-nums;
}

.ag-pagination__ellipsis {
  min-width: 1.5rem;
  text-align: center;
  color: var(--ag-text-muted);
  font-weight: 600;
  user-select: none;
}

.ag-pagination__page-meta {
  color: var(--ag-text-muted);
  font-weight: 500;
}

.ag-pagination__pages {
  display: none;
}

@media (min-width: 576px) {
  .ag-pagination__pages {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }
}

/* Scroll region for nested lists */
.ag-scroll-region {
  max-height: min(420px, 50vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.25rem;
}

/* Section divider */
.ag-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ag-section-title h5,
.ag-section-title h6 {
  margin: 0;
  font-weight: 700;
  color: var(--ag-text);
}

/* Welcome banner on dashboard */
.ag-welcome-banner {
  background: linear-gradient(135deg, rgba(27, 120, 216, 0.08), rgba(17, 205, 239, 0.06));
  border: 1px solid rgba(27, 120, 216, 0.12);
  border-radius: 1.25rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.ag-welcome-banner h4 {
  margin: 0 0 0.25rem;
  font-weight: 700;
  color: var(--ag-text);
}

.ag-welcome-banner p {
  margin: 0;
  color: var(--ag-text-muted);
  font-size: 0.95rem;
}

/* Loading skeleton pulse */
.ag-skeleton {
  background: linear-gradient(90deg, #e8f3fc 25%, #f8faff 50%, #e8f3fc 75%);
  background-size: 200% 100%;
  animation: ag-shimmer 1.4s ease infinite;
  border-radius: 1rem;
  min-height: 100px;
}

@keyframes ag-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Status badges */
.ag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

/* Job status colours — Created matches Pending (admin panel parity) */
.bg-job-created,
.badge.bg-job-created,
.bg-job-pending,
.badge.bg-job-pending,
.bg-gradient-pink,
.bg-gradient-danger {
  background-color: #dc3545 !important;
  background-image: none !important;
  color: #fff !important;
}

.bg-job-approved,
.badge.bg-job-approved {
  background-color: #0d6efd !important;
  color: #fff !important;
}

.bg-job-finished,
.badge.bg-job-finished {
  background-color: #28a745 !important;
  color: #fff !important;
}

.bg-job-cancelled,
.badge.bg-job-cancelled {
  background-color: #6c757d !important;
  color: #fff !important;
}

.bg-job-in-process,
.badge.bg-job-in-process,
.bg-gradient-purple,
.badge.bg-gradient-purple {
  background-color: #6f42c1 !important; /* In Process — match calendar accent */
  background-image: linear-gradient(310deg, #6f42c1 0%, #8b5cf6 100%) !important;
  color: #fff !important;
}

.ag-badge--created {
  background: rgba(232, 62, 140, 0.18);
  color: #be185d;
}

.ag-badge--pending {
  background: rgba(220, 53, 69, 0.15);
  color: #b91c1c;
}

.ag-badge--approved {
  background: rgba(13, 110, 253, 0.15);
  color: #1d4ed8;
}

.ag-badge--paid,
.ag-badge--finished {
  background: rgba(40, 167, 69, 0.15);
  color: #15803d;
}

.ag-badge--cancelled,
.ag-badge--draft,
.ag-badge--neutral {
  background: rgba(108, 117, 125, 0.15);
  color: #475569;
}

/* Focus visible for accessibility */
.ag-nav-link:focus-visible,
.ag-pagination__btn:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #1b78d8;
  outline-offset: 2px;
}

/* Calendar mobile polish */
@media (max-width: 767.98px) {
  .custom-calendar-style {
    padding: 0.65rem !important;
  }

  .custom-calendar-style .fc-header-toolbar {
    gap: 0.5rem;
  }

  .custom-calendar-style .fc-toolbar-chunk {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }

  .custom-calendar-style .fc-button {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.55rem !important;
  }

  .custom-calendar-style .fc-toolbar-title {
    font-size: 1.1rem !important;
    text-align: center;
  }

  .fc .fc-list-event-title,
  .fc .fc-list-event-time {
    font-size: 0.85rem;
  }
}

/* Generic form / card stacking */
@media (max-width: 767.98px) {
  .ag-card {
    padding: 0.85rem !important;
  }

  .card.mx-4,
  .card.my-2.mx-4 {
    margin-left: 0.35rem !important;
    margin-right: 0.35rem !important;
  }

  .row > [class*="col-"] {
    min-width: 0;
  }
}

/* ============================================================
   Premium forms inside cards — consistent alignment & spacing
   Scoped to .ag-card so auth / register pages stay untouched
   ============================================================ */
.ag-card > form,
.ag-card .card-body > form {
  width: 100%;
}

.ag-card .card-header {
  background: transparent !important;
  border: 0 !important;
  padding: 1.5rem 1.75rem 0 !important;
}

.ag-card .card-body {
  padding: 1.5rem 1.75rem 1.75rem !important;
}

.ag-card .card-header + .card-body {
  padding-top: 1.1rem !important;
}

.ag-card .card-header .ag-section-title {
  position: relative;
  padding-left: 0.85rem;
  line-height: 1.3;
}

.ag-card .card-header .ag-section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #1b78d8, #4fb6ff);
}

/* Consistent vertical rhythm between fields */
.ag-card .form-group {
  margin-bottom: 1.2rem;
}

.ag-card .card-body .row {
  --bs-gutter-x: 1.35rem;
  --bs-gutter-y: 0.35rem;
}

/* Field labels */
.ag-card .form-control-label,
.ag-card .form-label,
.ag-card label.form-control-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #344767;
}

/* Inputs / selects / textareas */
.ag-card .form-control,
.ag-card select.form-control,
.ag-card textarea.form-control,
.ag-card input.form-control {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.9rem;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #1f2937;
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.7rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.ag-card textarea.form-control {
  min-height: 112px;
  padding-top: 0.7rem;
  line-height: 1.55;
  resize: vertical;
}

/* Custom chevron for native selects */
.ag-card select.form-control {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 1rem;
}

/* Focus state */
.ag-card .form-control:focus,
.ag-card select.form-control:focus,
.ag-card textarea.form-control:focus,
.ag-card input.form-control:focus {
  border-color: #1b78d8;
  box-shadow: 0 0 0 3px rgba(27, 120, 216, 0.16);
  outline: none;
  background-color: #fff;
}

.ag-card .form-control::placeholder {
  color: #9aa7b8;
}

.ag-card .form-control:disabled,
.ag-card .form-control[readonly] {
  background-color: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

/* Checkbox / radio rows */
.ag-card .form-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 1.5rem;
  padding-left: 0;
  margin-bottom: 0.35rem;
}

.ag-card .form-check .form-check-input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  border-radius: 0.4rem;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  flex: 0 0 auto;
}

.ag-card .form-check .form-check-input:checked {
  background-color: #1b78d8;
  border-color: #1b78d8;
}

.ag-card .form-check .form-check-label {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
  cursor: pointer;
}

/* Helper / validation text */
.ag-card .form-text,
.ag-card .invalid-feedback,
.ag-card .text-danger.small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

/* Action buttons at the end of a form */
.ag-card .ag-form-actions,
.ag-card .form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.ag-card .ag-form-actions .btn,
.ag-card .form-actions .btn {
  min-height: 44px;
}

/* Tighter padding on small screens so fields breathe on mobile */
@media (max-width: 767.98px) {
  .ag-card .card-header {
    padding: 1.15rem 1.15rem 0 !important;
  }

  .ag-card .card-body {
    padding: 1.15rem 1.15rem 1.35rem !important;
  }

  .ag-card .card-body .row {
    --bs-gutter-x: 1rem;
  }

  .ag-card .form-group {
    margin-bottom: 1rem;
  }
}

/* ============================================================
   Premium data tables
   ============================================================ */
.ag-table-card {
  overflow: hidden;
}

.ag-table-shell {
  border-color: rgba(15, 23, 42, 0.07) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.ag-table-shell thead th {
  background: linear-gradient(180deg, #f4f7ff, #eaeffb) !important;
  color: #475569 !important;
  font-weight: 800 !important;
  letter-spacing: 0.05em !important;
  border-bottom: 1px solid rgba(27, 120, 216, 0.14) !important;
}

.ag-table-shell tbody tr {
  transition: background 0.15s ease;
}

.ag-table-shell tbody tr:nth-child(even) td {
  background: rgba(244, 247, 255, 0.55);
}

.ag-table-shell tbody tr:hover td {
  background: rgba(27, 120, 216, 0.07);
}

.ag-table-shell tbody tr:last-child td,
.ag-table-shell tbody tr:last-child .ag-td {
  border-bottom: 0 !important;
}

.ag-table-shell tbody tr {
  cursor: default;
}

/* Row edit / action buttons — compact and consistent */
.ag-table-shell .btn.btn-secondary,
.ag-table-shell .btn.btn-danger {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.ag-table-shell td.fit {
  white-space: nowrap;
}

.ag-table-shell td.fit .btn + .btn {
  margin-left: 6px !important;
}

/* Status badges inside tables — pill style */
.ag-table-shell .badge {
  padding: 0.4em 0.75em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

/* Compact icon actions — Jobs + Job Scheduling tables */
.ag-table-row-actions {
  gap: 0.35rem !important;
}

.ag-table-action-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0.5rem !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #1b78d8 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ag-table-action-btn i {
  font-size: 0.95rem;
  line-height: 1;
}

.ag-table-action-btn:hover,
.ag-table-action-btn:focus-visible {
  background: rgba(27, 120, 216, 0.1) !important;
  color: #0b5cad !important;
  outline: none;
}

.ag-table-action-btn:disabled,
.ag-table-action-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.ag-table-action-btn.is-busy {
  opacity: 0.85;
  pointer-events: none;
}

.ag-table-action-btn--view,
.ag-table-action-btn--edit,
.ag-table-action-btn--resume {
  color: #1b78d8 !important;
}

.ag-table-action-btn--pause {
  color: #d97706 !important;
}

.ag-table-action-btn--pause:hover,
.ag-table-action-btn--pause:focus-visible {
  background: rgba(217, 119, 6, 0.12) !important;
  color: #b45309 !important;
}

.ag-table-action-btn--delete {
  color: #dc3545 !important;
}

.ag-table-action-btn--delete:hover,
.ag-table-action-btn--delete:focus-visible {
  background: rgba(220, 53, 69, 0.1) !important;
  color: #b91c1c !important;
}

.ag-table-action-btn--locked {
  color: #64748b !important;
  cursor: default;
}

.ag-table-action-btn--locked:hover {
  background: transparent !important;
  color: #64748b !important;
}

/* Schedule Active / Paused — match Jobs status pill language */
.ag-schedule-status {
  border-left: 3px solid transparent;
  border-radius: 999px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ag-schedule-status--active {
  background: rgba(13, 148, 136, 0.16) !important;
  color: #0f766e !important;
  border-left-color: #0d9488 !important;
}

.ag-schedule-status--paused {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-left-color: #334155 !important;
}

.ag-td--staff-text {
  display: inline-block;
  max-width: 14rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* PortalListTable — aligned headers/cells + schedule layout */
.ag-portal-table__th,
.ag-portal-table__td {
  padding: 0.85rem 1rem !important;
  vertical-align: middle !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.ag-portal-table__th {
  white-space: nowrap;
  text-transform: uppercase;
  font-size: 0.68rem !important;
  letter-spacing: 0.05em !important;
  font-weight: 800 !important;
  color: #475569 !important;
}

.ag-portal-table__td {
  color: #344767;
  font-size: 0.875rem;
  line-height: 1.4;
}

.ag-portal-list-table {
  min-width: 52rem;
}

.ag-portal-table .ag-td--actions {
  white-space: nowrap;
  width: 1%;
  min-width: 8.5rem;
  padding-right: 0.85rem !important;
}

.ag-portal-table .ag-td--property-name {
  font-weight: 600;
  color: #102a43;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ag-schedule-list-toolbar {
  padding-bottom: 0.35rem;
}

.ag-schedule-list-card.ag-table-shell {
  overflow: visible !important;
}

.ag-schedule-list-card .card-header,
.ag-schedule-list-card .card-body {
  max-width: 100%;
  min-width: 0;
}

.ag-schedule-list-toolbar__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #102a43;
  line-height: 1.3;
}

.ag-schedule-list-toolbar__hint {
  font-size: 0.82rem;
  line-height: 1.4;
  max-width: 36rem;
}

.ag-list-empty {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

.ag-list-empty__icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(27, 120, 216, 0.08);
  color: #1b78d8;
  font-size: 1.25rem;
}

.ag-list-empty--error .ag-list-empty__icon {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}

.ag-list-empty--error .ag-list-empty__icon i {
  color: inherit;
}

.ag-schedule-list-card .ag-list-empty {
  min-height: 0;
}

/* Table search + toolbar */
.ag-table-toolbar {
  align-items: center !important;
}

.ag-search-form {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.ag-search-form .form-control {
  min-height: 46px;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

.ag-search-form .btn {
  min-height: 46px;
  white-space: nowrap;
  flex: 0 0 auto !important;
}

/* Pagination controls */
.ag-table-card .btn.btn-outline-primary,
.ag-table-card .btn.btn-danger {
  min-width: 40px;
}

/* Mobile stacked cards */
.ag-mobile-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ag-mobile-card:hover {
  border-color: rgba(27, 120, 216, 0.28);
  box-shadow: 0 10px 24px rgba(27, 120, 216, 0.12);
}

.ag-mobile-action-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem !important;
}

/* Compact job select checkbox — keep 44px hit area, small visual box */
.ag-job-select-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
  user-select: none;
}

.ag-job-select-check .form-check-input {
  width: 1.15rem !important;
  height: 1.15rem !important;
  min-width: 1.15rem !important;
  min-height: 1.15rem !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0.3rem;
  border: 1.5px solid #94a3b8;
  background-color: #fff;
  background-image: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.7rem 0.7rem;
  box-shadow: none;
  vertical-align: middle;
}

.ag-job-select-check .form-check-input:checked {
  background-color: #1b78d8 !important;
  border-color: #1b78d8 !important;
  /* White checkmark */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m5 10 3.5 3.5L15 7'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 0.75rem 0.75rem !important;
}

.ag-job-select-check .form-check-input:focus {
  box-shadow: 0 0 0 0.15rem rgba(27, 120, 216, 0.25);
  border-color: #1b78d8;
}

.ag-job-select-check .form-check-input:checked:focus {
  box-shadow: 0 0 0 0.15rem rgba(27, 120, 216, 0.35);
}

.ag-job-select-check--locked {
  color: #94a3b8;
  cursor: default;
}

.ag-job-select-check--locked i {
  font-size: 0.95rem;
  line-height: 1;
}

.ag-mobile-action-btn.ag-job-select-check {
  padding: 0 !important;
}

.ag-td--checkbox .ag-job-select-check {
  min-width: 2rem;
  min-height: 2rem;
}

/* Job update — sticky blocked-edit banner on phone */
@media (max-width: 767.98px) {
  .ag-job-edit-blocked-banner {
    position: sticky;
    top: 0.35rem;
    z-index: 30;
    margin-bottom: 0.75rem !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  }
}

/* Collapsible form sections (mobile); stepped open layout on md+ */
.ag-form-section-collapse {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 1rem;
  background: #fff;
  padding: 0;
  overflow: hidden;
  margin-bottom: 0.85rem;
}

.ag-form-section-collapse__summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: #344767;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, #f8faff, #f1f5ff);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.ag-form-section-collapse__summary::-webkit-details-marker {
  display: none;
}

.ag-form-section-collapse__summary::after {
  content: "▾";
  float: right;
  color: #64748b;
  font-size: 0.85rem;
}

.ag-form-section-collapse:not([open]) .ag-form-section-collapse__summary::after {
  content: "▸";
}

.ag-form-section-collapse__body {
  padding: 1rem;
}

.ag-form-section-collapse__intro {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eef2f7;
}

.ag-form-section-collapse__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.3;
}

.ag-form-section-collapse__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #4e73df;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ag-form-section-collapse__desc {
  margin: 0.35rem 0 0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.45;
}

.ag-form-section-collapse__content .form-control-label {
  margin-bottom: 0.35rem;
}

.ag-job-form .card-body {
  padding-top: 1.15rem;
}

.ag-job-form .ag-form-section-collapse + .ag-form-section-collapse {
  margin-top: 0.15rem;
}

.ag-job-form {
  width: 100%;
}

.ag-job-form .ag-eot-extra-card__note,
.ag-job-form .ag-eot-custom-card__fields {
  max-width: none;
}

.ag-review-modal__section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.ag-review-modal__section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.ag-review-modal__section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
}

.ag-review-modal__section-title i {
  color: #4e73df;
}

.ag-review-item {
  height: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}

.ag-review-item__label {
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.68rem;
  font-weight: 650;
  margin-bottom: 0.2rem;
}

.ag-review-item__value {
  color: #0f172a;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.35;
  word-break: break-word;
}

@media (min-width: 768px) {
  .ag-form-section-collapse {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    background: #fff;
    margin-bottom: 1rem;
    overflow: hidden;
  }

  .ag-form-section-collapse__summary {
    display: none;
  }

  .ag-form-section-collapse__body {
    padding: 1.15rem 1.25rem 1.25rem;
  }
}

/* Job details — stack sidebar chat below content until xl */
@media (max-width: 1199.98px) {
  .ag-job-details-page .ag-job-details-sidebar {
    order: 3;
  }

  .ag-job-details-page .ag-job-chat-sticky {
    position: static !important;
    width: 100%;
    max-width: 100%;
  }

  .ag-job-details-page .table-responsive {
    overflow-x: visible;
  }

  .ag-job-details-page .table {
    min-width: 0 !important;
  }
}

/* Job action toolbar — wrap + full-width primary actions on phone */
.job-actions-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.job-details-fields .form-group {
  margin-bottom: 0;
}

.job-details-fields .form-control-label {
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: #475569;
}

.job-details-fields .form-control[readonly],
.job-details-fields .form-control:disabled,
.job-status-field {
  background-color: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
  min-height: 2.65rem;
}

.job-status-field {
  display: flex;
  align-items: center;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.ag-job-details-page .card-header.job-details-header {
  padding-bottom: 1rem;
}

.ag-job-details-page .job-cancel-notice {
  max-width: 100%;
}

@media (max-width: 575.98px) {
  .job-actions-toolbar .btn:not(.btn-sm),
  .job-actions-toolbar .job-action-btn,
  .job-actions-toolbar .cancel-job-wrapper,
  .job-actions-toolbar .cancel-job-wrapper .btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .job-actions-toolbar .btn.p-3,
  .job-actions-toolbar .job-action-btn {
    min-height: 44px;
  }

  .ag-job-details-page .card-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (min-width: 576px) and (max-width: 991.98px) {
  .job-actions-toolbar .job-action-btn {
    flex: 1 1 calc(50% - 0.5rem);
  }
}

/* Profile contact — wrap long email, tap-to-copy affordance */
.profile-email-contact {
  min-width: 0;
  max-width: 100%;
}

.profile-email-contact__links {
  flex-wrap: wrap;
  word-break: break-word;
}

.profile-contact-copy {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: inherit;
  color: inherit;
  font: inherit;
  word-break: break-all;
}

.profile-contact-copy:hover {
  text-decoration: underline;
}

.ag-profile-card .card-body {
  overflow-x: hidden;
}

.ag-profile-body {
  padding-top: 1.25rem !important;
}

.ag-profile-email-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 1rem 1.15rem 0;
  padding: 0.95rem 1.05rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(27, 120, 216, 0.08), rgba(7, 30, 79, 0.03));
  border: 1px solid rgba(27, 120, 216, 0.14);
}

.ag-profile-email-banner__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  background: #fff;
  color: #1b78d8;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.ag-profile-email-banner__lead {
  font-size: 0.9rem;
  font-weight: 650;
  color: #102a43;
}

.ag-profile-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.15rem 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.2rem;
  border-radius: 1.15rem;
  background:
    linear-gradient(135deg, rgba(27, 120, 216, 0.1), rgba(17, 205, 239, 0.05)),
    #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.ag-profile-hero__avatar {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 999px;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  background: #dbeafe;
  padding: 0;
  display: grid;
  place-items: center;
}

.ag-profile-hero__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ag-profile-hero__initials {
  font-size: 2rem;
  font-weight: 750;
  color: #0f3d75;
}

.ag-profile-hero__camera,
.ag-profile-hero__overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  place-items: center;
  height: 2rem;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 0.8rem;
}

.ag-profile-hero__overlay {
  inset: 0;
  height: auto;
  background: rgba(255, 255, 255, 0.7);
}

.ag-profile-hero__body {
  flex: 1 1 14rem;
  min-width: 0;
}

.ag-profile-hero__role {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1b78d8;
}

.ag-profile-hero__name {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 750;
  color: #102a43;
}

.ag-profile-hero__email {
  color: #64748b;
  font-size: 0.92rem;
  word-break: break-all;
}

.ag-profile-hero__progress-label,
.ag-profile-hero__progress-value {
  font-size: 0.8rem;
  font-weight: 650;
  color: #475569;
}

.ag-profile-hero__meter {
  height: 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.ag-profile-hero__meter .progress-bar {
  border-radius: 999px;
}

.ag-profile-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ag-profile-section {
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: 1.05rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.ag-profile-section__head {
  margin-bottom: 1rem;
}

.ag-profile-section-title {
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ag-profile-section__hint {
  margin-top: 0.45rem;
  color: #64748b;
  font-size: 0.84rem;
}

.ag-profile-reminder,
.ag-profile-danger-zone {
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  min-height: 100%;
}

.ag-profile-danger-zone {
  background: #fff7f7;
  border-color: rgba(220, 38, 38, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ag-profile-fields .form-label {
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}

.ag-profile-fields .form-control,
.ag-profile-fields .form-select {
  min-height: 2.75rem;
  border-radius: 0.7rem;
}

.ag-profile-actions {
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(8px);
}

.ag-profile-actions .btn {
  min-height: 2.85rem;
  border-radius: 0.8rem;
  font-weight: 700;
}

.ag-profile-missing {
  border-radius: 0.9rem;
  border-color: rgba(245, 158, 11, 0.35);
}

@media (max-width: 767.98px) {
  .ag-profile-email-banner {
    margin: 0.85rem 0.85rem 0;
    flex-direction: column;
  }

  .ag-profile-hero {
    flex-direction: column;
    text-align: center;
  }

  .ag-profile-hero__progress {
    text-align: left;
  }

  .ag-profile-actions {
    justify-content: stretch;
  }

  .ag-profile-actions .btn {
    width: 100%;
  }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ag-page-content,
  .ag-stat-card,
  .ag-property-card,
  .ag-day-job-item,
  #sidenav-main.sidenav {
    animation: none;
    transition: none !important;
  }
}

/* Sprint 4 — rate limit alerts, mobile card actions, standalone tables */
.ag-rate-limit-alert {
  background: #fff8e6 !important;
  border: 1px solid rgba(245, 158, 11, 0.35) !important;
  color: #78350f !important;
  font-weight: 600;
}

/* Readable form alerts (Argon light danger + text-white was unreadable) */
.ag-form-alert--error,
.ag-job-form .alert-danger,
.ag-job-form .alert.alert-danger {
  background: #c53030 !important;
  border: 1px solid #9b2c2c !important;
  color: #ffffff !important;
  font-weight: 600;
}

.ag-form-alert--info {
  background: #2b6cb0 !important;
  border: 1px solid #2c5282 !important;
  color: #ffffff !important;
  font-weight: 600;
}

.ag-preferred-book-form .alert-danger,
.ag-preferred-book-form .ag-form-alert--error {
  background: #c53030 !important;
  border-color: #9b2c2c !important;
  color: #ffffff !important;
}

.ag-mobile-card__actions {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.ag-mobile-card__actions .btn {
  min-height: 2.5rem;
}

.ag-mobile-card__actions .ag-table-row-actions {
  width: 100%;
  justify-content: flex-start !important;
  gap: 0.45rem !important;
}

.ag-mobile-card__actions .ag-table-action-btn {
  width: 2.65rem;
  height: 2.65rem;
  min-width: 2.65rem;
  min-height: 2.65rem;
  border-radius: 0.65rem !important;
  background: rgba(27, 120, 216, 0.06) !important;
}

.ag-mobile-card__actions .ag-table-action-btn--pause {
  background: rgba(217, 119, 6, 0.1) !important;
}

.ag-mobile-card__actions .ag-table-action-btn i {
  font-size: 1rem;
}

@media (max-width: 767.98px) {
  .ag-mobile-cards .ag-mobile-card {
    cursor: default;
  }

  .ag-mobile-cards .ag-mobile-card:active {
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  }

  .ag-schedule-list-toolbar {
    flex-direction: column;
    align-items: stretch !important;
  }

  .ag-schedule-list-toolbar .btn {
    width: 100%;
    min-height: 2.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ag-schedule-list-card .card-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .ag-schedule-list-card .card-body {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
  .ag-portal-list-table {
    min-width: 48rem;
  }

  .ag-portal-table__th,
  .ag-portal-table__td {
    padding: 0.75rem 0.85rem !important;
  }
}

/* Schedule list: card layout through tablet — 7 columns don't fit comfortably */
@media (max-width: 991.98px) {
  .ag-schedule-list .ag-table-desktop {
    display: none !important;
  }

  .ag-schedule-list .ag-mobile-cards {
    display: flex !important;
  }
}

/* Preferred Staff — Book cleaner modal */
.ag-preferred-book-dialog {
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
}

.ag-preferred-book-dialog .modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

.modal:has(.ag-preferred-book-form) .modal-dialog {
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
}

.modal:has(.ag-preferred-book-form) .modal-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
}

.ag-preferred-book-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

.ag-preferred-book-form > .modal-header,
.ag-preferred-book-form > .modal-footer {
  flex: 0 0 auto;
}

.ag-preferred-book-form > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-top: 0.5rem;
}

.ag-preferred-book-form__slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1.15rem;
  border-radius: 0.75rem;
  border: 1px solid #dbe7f5;
  background: #f7fafc;
}

.ag-preferred-book-form__slot-name {
  font-weight: 650;
  color: #1e293b;
  margin-right: 0.15rem;
}

.ag-preferred-book-form__section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.ag-preferred-book-form__section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0.35rem;
  padding-bottom: 0;
}

.ag-preferred-book-form__section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin: 0 0 0.75rem;
}

.ag-preferred-book-form .form-control-label {
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

.ag-preferred-book-form .form-group {
  margin-bottom: 0;
}

.ag-preferred-book-form__check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.7rem;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #fff;
  cursor: pointer;
}

.ag-preferred-book-form__check input {
  margin: 0;
  flex-shrink: 0;
}

.ag-preferred-book-form__check span {
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.25;
}

.ag-preferred-book-form__eot-end {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(1.5em + 0.75rem + 2px);
  padding: 0.45rem 0.75rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.5rem;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.875rem;
}

.ag-preferred-book-form__eot-end small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  line-height: 1.3;
}

.ag-property-preview-compact {
  margin-top: 0.65rem;
}

.ag-property-preview-compact__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ag-property-chip {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
}

.ag-property-chip__label {
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
}

.ag-property-chip__value {
  color: #0f172a;
  font-weight: 600;
  white-space: nowrap;
}

.ag-property-preview-compact__hint {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: #64748b;
}

/* Client EOT band picker — scrollable rows with price on the right */
.ag-eot-band-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 18rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
}

.ag-eot-band-card {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  text-align: left;
  border: 1px solid #e2e8f0 !important;
  border-radius: 0.75rem !important;
  background: #fff !important;
  box-shadow: none !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.ag-eot-band-card:hover {
  border-color: #93c5fd !important;
  background: #f8fbff !important;
}

.ag-eot-band-card[data-selected="true"] {
  border-color: #4e73df !important;
  background: rgba(78, 115, 223, 0.08) !important;
  box-shadow: 0 0 0 2px rgba(78, 115, 223, 0.18) !important;
}

.ag-eot-band-card__main {
  min-width: 0;
  flex: 1 1 auto;
}

.ag-eot-band-card__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
}

.ag-eot-band-card__name {
  font-size: 0.9rem;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ag-eot-band-card__badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #e8eefc;
  color: #2e59d9;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.ag-eot-band-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.4rem;
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.35;
}

.ag-eot-band-card__price {
  flex-shrink: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1cc88a;
  white-space: nowrap;
}

@media (min-width: 992px) {
  .ag-preferred-book-dialog,
  .modal:has(.ag-preferred-book-form) .modal-dialog {
    max-width: 860px;
  }
}

/* Jobs list — mobile toolbar + card density */
.ag-jobs-bulk-bar {
  margin-bottom: 0.85rem !important;
}

.ag-jobs-bulk-bar__btn {
  min-height: 40px;
}

@media (max-width: 767.98px) {
  .ag-jobs-bulk-bar {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    padding: 0.75rem 0.85rem !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .ag-jobs-bulk-bar__btn {
    flex: 1 1 auto;
    width: 100%;
  }

  .ag-mobile-cards {
    padding: 0.35rem 0 0.75rem !important;
    gap: 0.85rem !important;
  }

  .ag-mobile-card {
    padding: 1rem 0.95rem !important;
    border-radius: 1.05rem !important;
  }

  .ag-mobile-card > .d-flex.flex-wrap.gap-2.mb-3 {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    gap: 0.45rem !important;
  }

  .ag-mobile-card__title {
    font-size: 1rem !important;
    margin-bottom: 0.65rem !important;
  }

  .ag-mobile-card__row {
    font-size: 0.86rem !important;
    padding: 0.35rem 0 !important;
  }

  .ag-mobile-action-btn,
  .ag-mobile-action-btn-group .btn {
    min-width: 42px !important;
    min-height: 42px !important;
  }

  .ag-table-card .card-header {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  .ag-table-toolbar {
    gap: 0.65rem !important;
  }

  .ag-table-toolbar .btn.btn-primary {
    width: 100%;
    min-height: 46px;
  }
}

/* ---------- Client dashboard polish ---------- */
.ag-client-dash {
  width: 100%;
  font-family: Poppins, "Open Sans", ui-sans-serif, system-ui, sans-serif;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}

.ag-client-dash h4,
.ag-client-dash h6,
.ag-client-dash p,
.ag-client-dash span,
.ag-client-dash a,
.ag-client-dash button,
.ag-client-dash .btn,
.ag-client-dash .badge,
.ag-client-dash .card-header,
.ag-client-dash .card-body,
.ag-client-dash .ag-count-card,
.ag-client-dash .ag-prop-card,
.ag-client-dash .ag-prop-card__title,
.ag-client-dash .ag-prop-card__meta,
.ag-client-dash .ag-prebook-item__title,
.ag-client-dash .ag-prebook-item__meta,
.ag-client-dash .ag-list-empty h6,
.ag-client-dash .ag-list-empty p,
.ag-client-dash .ag-today-jobs-table,
.ag-client-dash .ag-today-jobs-table h6,
.ag-client-dash .ag-today-jobs-table p {
  font-family: Poppins, "Open Sans", ui-sans-serif, system-ui, sans-serif !important;
}

.ag-client-dash__hero {
  border-radius: 1.15rem !important;
  background:
    linear-gradient(135deg, rgba(27, 120, 216, 0.1) 0%, rgba(255, 255, 255, 0.95) 42%, #fff 100%);
  overflow: hidden;
  position: relative;
}

.ag-client-dash__hero::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27, 120, 216, 0.16), transparent 70%);
  pointer-events: none;
}

.ag-client-dash__eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ag-primary, #1b78d8);
  line-height: 1.3;
}

.ag-client-dash__title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.ag-client-dash__hero .small,
.ag-client-dash__hero p.text-muted {
  font-size: 0.9rem !important;
  font-weight: 400;
  line-height: 1.5;
  color: #64748b !important;
}

.ag-client-dash__hero .btn {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.ag-client-dash .card-header h6,
.ag-client-dash .ag-card-header h6 {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.ag-count-cards .ag-count-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.95rem;
  width: 100%;
  min-height: 5.5rem;
  padding: 1.05rem 1.15rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  color: inherit;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

a.ag-count-card:hover {
  border-color: rgba(27, 120, 216, 0.4);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
  color: inherit;
}

.ag-count-card__icon {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 0.85rem;
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: var(--ag-gradient-primary, linear-gradient(135deg, #1b78d8, #0d4f9e));
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 6px 14px rgba(27, 120, 216, 0.28);
}

.ag-count-card__icon i {
  color: #fff !important;
  opacity: 1 !important;
  line-height: 1;
}

.ag-count-card__body {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 0;
}

.ag-count-card__label {
  display: block !important;
  font-family: Poppins, "Open Sans", ui-sans-serif, system-ui, sans-serif !important;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  line-height: 1.25;
}

.ag-count-card__value {
  display: block !important;
  font-family: Poppins, "Open Sans", ui-sans-serif, system-ui, sans-serif !important;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  letter-spacing: -0.02em;
  word-break: break-word;
}

@media (min-width: 992px) {
  .ag-count-card__value {
    font-size: 1.5rem;
  }
}

.ag-count-card__hint {
  display: block !important;
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
  line-height: 1.2;
}

.ag-client-dash .ag-prop-card__title {
  font-family: Poppins, "Open Sans", ui-sans-serif, system-ui, sans-serif !important;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ag-client-dash .ag-prop-card__meta,
.ag-client-dash .ag-prop-card__add-label {
  font-family: Poppins, "Open Sans", ui-sans-serif, system-ui, sans-serif !important;
  font-size: 0.75rem;
  font-weight: 400;
}

.ag-client-dash .ag-prebook-item__title {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ag-client-dash .ag-prebook-item__meta {
  font-size: 0.78rem;
  font-weight: 400;
  color: #64748b;
}

.ag-client-dash .ag-list-empty h6 {
  font-size: 1rem;
  font-weight: 700;
}

.ag-client-dash .ag-list-empty p {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
}

.ag-client-dash__panel {
  border-radius: 1.1rem !important;
}

.ag-client-dash .ag-prop-card {
  width: min(240px, 78vw);
  min-height: 148px;
}

.ag-client-dash .ag-prop-card--add {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ag-prop-dots {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.ag-prop-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: #cbd5e1;
  transition: width 0.18s ease, background 0.18s ease;
}

.ag-prop-dot.is-active {
  width: 1rem;
  background: var(--ag-primary, #1b78d8);
}

.ag-client-dash .ag-prebook-list {
  max-height: min(52vh, 480px);
  min-height: 220px;
}

.ag-client-dash .ag-list-empty {
  border-radius: 0.9rem;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
}

@media (max-width: 991.98px) {
  .ag-client-dash .ag-prebook-list {
    max-height: none;
    min-height: 0;
  }
}

/* ========== Desktop sidebar collapse — edge-mounted chevron ========== */
@media (min-width: 1200px) {
  /* Beat Argon/styles overflow:hidden so the edge chevron can sit outside */
  #sidenav-main.sidenav.ag-sidebar,
  #sidenav-main.sidenav.ag-sidebar.navbar-vertical.navbar-expand-xs {
    overflow: visible !important;
  }

  #sidenav-main.ag-sidebar .navbar-collapse,
  #sidenav-main.ag-sidebar #sidenav-collapse-main,
  #sidenav-main.ag-sidebar.navbar-vertical.navbar-expand-xs .navbar-collapse {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  #sidenav-main.ag-sidebar .sidenav-footer {
    overflow: hidden;
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
  }

  #sidenav-main.ag-sidebar .ag-sidebar__collapse {
    position: absolute;
    top: 3.35rem;
    right: -0.85rem;
    z-index: 40;
    width: 1.7rem;
    height: 1.7rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.28);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
      box-shadow 0.15s ease, transform 0.15s ease;
  }

  #sidenav-main.ag-sidebar .ag-sidebar__collapse i {
    font-size: 0.58rem;
    line-height: 1;
  }

  #sidenav-main.ag-sidebar .ag-sidebar__collapse:hover,
  #sidenav-main.ag-sidebar .ag-sidebar__collapse:focus-visible {
    background: #071e4f;
    border-color: #071e4f;
    color: #ffffff;
    outline: none;
    box-shadow: 0 6px 16px rgba(7, 30, 79, 0.35);
  }

  #sidenav-main.ag-sidebar .ag-sidebar__collapse:active {
    transform: scale(0.94);
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar,
  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar.is-collapsed {
    width: 5.5rem !important;
    min-width: 5.5rem !important;
    max-width: 5.5rem !important;
  }

  body.ag-sidebar-collapsed .main-content.ag-shell-main {
    margin-left: calc(5.5rem + 1.25rem + 0.75rem) !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .navbar-brand {
    display: none !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .sidenav-header {
    min-height: 3.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 0.35rem !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .ag-sidebar__collapse {
    top: 1.15rem;
    right: -0.9rem;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .nav-link-text,
  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .ag-logout-btn__label,
  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .ag-sidebar__section-label {
    display: none !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .ag-sidebar__section {
    margin-top: 0.35rem !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .navbar-collapse,
  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar #sidenav-collapse-main {
    padding-left: 0.35rem !important;
    padding-right: 0.35rem !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .nav-item {
    display: flex;
    justify-content: center;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .nav-link {
    justify-content: center !important;
    align-items: center !important;
    width: 2.85rem !important;
    min-height: 2.85rem !important;
    margin: 0.2rem auto !important;
    padding: 0 !important;
    border-radius: 0.75rem !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .nav-link .icon {
    margin: 0 !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .nav-link.active {
    background: #071e4f !important;
    box-shadow: 0 4px 12px rgba(7, 30, 79, 0.22);
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .nav-link.active .icon i {
    color: #fff !important;
    opacity: 1 !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .sidenav-footer {
    padding: 0.65rem 0.45rem 1rem !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .ag-logout-btn {
    width: 2.85rem !important;
    min-width: 2.85rem !important;
    max-width: 2.85rem !important;
    min-height: 2.85rem !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border-radius: 0.75rem !important;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .ag-logout-btn i {
    margin: 0 !important;
  }

  /* Soft UI style tooltips when labels are hidden */
  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .nav-link[aria-label],
  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .ag-logout-btn[aria-label] {
    position: relative;
  }

  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .nav-link[aria-label]:hover::after,
  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar .ag-logout-btn[aria-label]:hover::after {
    content: attr(aria-label);
    position: absolute;
    left: calc(100% + 0.65rem);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: #0f172a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.55rem;
    border-radius: 0.4rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
    z-index: 40;
    pointer-events: none;
  }
}

/* Mobile/tablet drawer — ignore desktop collapse rail */
@media (max-width: 1199.98px) {
  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar,
  body.ag-sidebar-collapsed #sidenav-main.ag-sidebar.is-collapsed {
    width: auto !important;
    min-width: 0 !important;
    max-width: 15.625rem !important;
  }

  body.ag-sidebar-collapsed .main-content.ag-shell-main {
    margin-left: 0 !important;
  }

  #sidenav-main.ag-sidebar .ag-sidebar__collapse {
    display: none !important;
  }
}

