/**
 * ABPL Material theme layer — v2.63.0
 *
 * Presentation-only. Loaded AFTER abpl-app.css / abpl-premium.css (dashboard)
 * and abpl-auth.css (login). It changes look-and-feel only: colour, radius,
 * elevation, motion and the mobile bottom navigation. No layout contract of
 * the existing bundles is altered, so every page keeps working; delete this
 * file (and its enqueue) to return to the previous look.
 *
 * Brand colours still come from Settings -> Branding (--abpl-primary,
 * --abpl-blue, --abpl-gold); the extra accents below only add variety to
 * cards/icons, they never replace the brand colour.
 */

:root {
  --abpl-m-teal:   var(--abpl-primary, #0f766e);
  --abpl-m-blue:   var(--abpl-blue, #2563eb);
  --abpl-m-violet: #7c3aed;
  --abpl-m-pink:   #db2777;
  --abpl-m-amber:  #f59e0b;
  --abpl-m-cyan:   #0891b2;
  --abpl-m-radius: 20px;
  --abpl-m-radius-sm: 14px;
  --abpl-m-ease: cubic-bezier(.2, .8, .2, 1);
  --abpl-m-shadow: 0 1px 2px rgba(30, 41, 90, .05), 0 10px 28px -8px rgba(30, 41, 90, .14);
  --abpl-m-shadow-hover: 0 2px 4px rgba(30, 41, 90, .06), 0 18px 38px -10px rgba(30, 41, 90, .22);
  --abpl-m-bottomnav-h: 68px;
}

/* ---------------------------------------------------------------------------
 * Canvas — soft tinted background instead of flat grey
 * ------------------------------------------------------------------------ */
body.abpl-app {
  background:
    radial-gradient(900px 480px at 100% -10%, color-mix(in srgb, var(--abpl-m-violet) 9%, transparent), transparent 60%),
    radial-gradient(800px 420px at -10% 0%, color-mix(in srgb, var(--abpl-m-teal) 10%, transparent), transparent 60%),
    #f4f6fc;
}
#abpl-root .abpl-main { background: transparent; }

/* ---------------------------------------------------------------------------
 * Sidebar (desktop) — white rail, gradient active pill, coloured icon chips
 * ------------------------------------------------------------------------ */
#abpl-root .abpl-sidebar {
  background: #fff;
  border-right: 1px solid rgba(30, 41, 90, .06);
  box-shadow: 10px 0 40px -20px rgba(30, 41, 90, .18);
}
#abpl-root .abpl-sidebar__mark span:nth-child(1) { background: var(--abpl-m-teal); }
#abpl-root .abpl-sidebar__mark span:nth-child(2) { background: var(--abpl-m-blue); }
#abpl-root .abpl-sidebar__mark span:nth-child(3) { background: var(--abpl-m-violet); }
#abpl-root .abpl-sidebar__mark span:nth-child(4) { background: var(--abpl-m-amber); }

#abpl-root .abpl-nav-link {
  border-radius: 14px;
  transition: background .18s var(--abpl-m-ease), color .18s, transform .18s var(--abpl-m-ease), box-shadow .18s;
}
#abpl-root .abpl-nav-link__icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--abpl-m-blue) 10%, #fff);
  color: var(--abpl-m-blue);
  flex: 0 0 auto;
  transition: background .18s, color .18s, transform .18s var(--abpl-m-ease);
}
#abpl-root .abpl-sidebar__group:nth-of-type(6n+1) .abpl-nav-link__icon { background: color-mix(in srgb, var(--abpl-m-teal) 12%, #fff);   color: var(--abpl-m-teal); }
#abpl-root .abpl-sidebar__group:nth-of-type(6n+2) .abpl-nav-link__icon { background: color-mix(in srgb, var(--abpl-m-blue) 12%, #fff);   color: var(--abpl-m-blue); }
#abpl-root .abpl-sidebar__group:nth-of-type(6n+3) .abpl-nav-link__icon { background: color-mix(in srgb, var(--abpl-m-violet) 12%, #fff); color: var(--abpl-m-violet); }
#abpl-root .abpl-sidebar__group:nth-of-type(6n+4) .abpl-nav-link__icon { background: color-mix(in srgb, var(--abpl-m-pink) 12%, #fff);   color: var(--abpl-m-pink); }
#abpl-root .abpl-sidebar__group:nth-of-type(6n+5) .abpl-nav-link__icon { background: color-mix(in srgb, var(--abpl-m-amber) 16%, #fff);  color: #b45309; }
#abpl-root .abpl-sidebar__group:nth-of-type(6n)   .abpl-nav-link__icon { background: color-mix(in srgb, var(--abpl-m-cyan) 12%, #fff);   color: var(--abpl-m-cyan); }

#abpl-root .abpl-nav-link:hover { background: color-mix(in srgb, var(--abpl-m-blue) 6%, #fff); transform: translateX(2px); }
/* Selector mirrors premium.css's per-section active rules (id + group attr)
   so, loading later, this wins on equal specificity without !important. */
#abpl-root .abpl-nav-link.is-active,
#abpl-root .abpl-nav-link.is-active:hover,
#abpl-root .abpl-sidebar__group[data-abpl-nav-group] .abpl-nav-link.is-active,
#abpl-root .abpl-sidebar__group[data-abpl-nav-group] .abpl-nav-link.is-active:hover,
#abpl-root .abpl-nav-link.is-active:active,
#abpl-root .abpl-nav-link.is-active:focus {
  /* premium.css pins the active row with !important (touch-focus guard), so
     the theme must use !important on these two properties to restyle it. */
  background: linear-gradient(135deg, var(--abpl-m-teal), var(--abpl-m-blue)) !important;
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--abpl-m-blue) 70%, transparent);
}
#abpl-root .abpl-nav-link.is-active .abpl-nav-link__icon,
#abpl-root .abpl-sidebar__group[data-abpl-nav-group] .abpl-nav-link.is-active .abpl-nav-link__icon {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}
#abpl-root .abpl-nav-link.is-active::before { background: rgba(255, 255, 255, .0); }
#abpl-root .abpl-sidebar__group-label { color: #8a94ab; }

/* ---------------------------------------------------------------------------
 * Header — frosted bar, round icon buttons
 * ------------------------------------------------------------------------ */
#abpl-root .abpl-header {
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(30, 41, 90, .06);
}
#abpl-root .abpl-header__title { font-weight: 800; letter-spacing: -.015em; }
#abpl-root .abpl-icon-btn,
#abpl-root .abpl-burger {
  border-radius: 14px;
  background: color-mix(in srgb, var(--abpl-m-blue) 8%, #fff);
  border: 0;
  color: var(--abpl-m-blue);
  transition: transform .18s var(--abpl-m-ease), background .18s;
}
#abpl-root .abpl-icon-btn:hover,
#abpl-root .abpl-burger:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--abpl-m-blue) 14%, #fff); }
#abpl-root .abpl-icon-btn__count { background: linear-gradient(135deg, var(--abpl-m-pink), #ef4444); }
#abpl-root .abpl-search .abpl-input { border-radius: 999px; background: #f1f4fb; border-color: transparent; }
#abpl-root .abpl-search .abpl-input:focus { background: #fff; border-color: var(--abpl-m-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--abpl-m-blue) 16%, transparent); }
#abpl-root .abpl-profile-trigger { border-radius: 999px; }

/* ---------------------------------------------------------------------------
 * Page heading, panels, cards
 * ------------------------------------------------------------------------ */
#abpl-root .abpl-page-head h1,
#abpl-root .abpl-page-head h2 { font-weight: 800; letter-spacing: -.02em; }

#abpl-root .abpl-panel,
#abpl-root .abpl-card,
#abpl-root .abpl-stat {
  border: 1px solid rgba(30, 41, 90, .06);
  border-radius: var(--abpl-m-radius);
  box-shadow: var(--abpl-m-shadow);
  transition: transform .22s var(--abpl-m-ease), box-shadow .22s;
}
#abpl-root .abpl-panel { padding: clamp(16px, 2vw, 26px); }
#abpl-root .abpl-panel:hover,
#abpl-root .abpl-stat:hover { box-shadow: var(--abpl-m-shadow-hover); }
#abpl-root .abpl-stat:hover { transform: translateY(-3px); }
#abpl-root .abpl-panel__title { font-weight: 800; letter-spacing: -.01em; }

/* Grid children may shrink, so wide tables scroll inside their own wrapper
   instead of stretching the whole page sideways on phones. */
#abpl-root .abpl-panels > *,
#abpl-root .abpl-stats > *,
#abpl-root .abpl-panel { min-width: 0; max-width: 100%; }
#abpl-root .abpl-table-wrap { max-width: 100%; }

/* Stat tiles: colourful, cycling accent per tile (solid ones only — the
   existing gradient variants keep their own colours). */
#abpl-root .abpl-stats > .abpl-stat:not(.abpl-stat--grad) {
  --m-acc: var(--abpl-m-teal);
  background:
    radial-gradient(160px 120px at 100% 0%, color-mix(in srgb, var(--m-acc) 16%, transparent), transparent 70%),
    #fff;
  border-left: 0;
  border-top: 4px solid var(--m-acc);
}
#abpl-root .abpl-stats > .abpl-stat:nth-child(6n+2):not(.abpl-stat--grad) { --m-acc: var(--abpl-m-blue); }
#abpl-root .abpl-stats > .abpl-stat:nth-child(6n+3):not(.abpl-stat--grad) { --m-acc: var(--abpl-m-violet); }
#abpl-root .abpl-stats > .abpl-stat:nth-child(6n+4):not(.abpl-stat--grad) { --m-acc: var(--abpl-m-pink); }
#abpl-root .abpl-stats > .abpl-stat:nth-child(6n+5):not(.abpl-stat--grad) { --m-acc: var(--abpl-m-amber); }
#abpl-root .abpl-stats > .abpl-stat:nth-child(6n):not(.abpl-stat--grad)   { --m-acc: var(--abpl-m-cyan); }
#abpl-root .abpl-stat__value { font-weight: 800; letter-spacing: -.03em; }
#abpl-root .abpl-stat--teal   { background: linear-gradient(135deg, var(--abpl-m-teal), var(--abpl-m-cyan)); }
#abpl-root .abpl-stat--blue   { background: linear-gradient(135deg, var(--abpl-m-blue), var(--abpl-m-violet)); }
#abpl-root .abpl-stat--purple { background: linear-gradient(135deg, var(--abpl-m-violet), var(--abpl-m-pink)); }
#abpl-root .abpl-stat--green  { background: linear-gradient(135deg, #16a34a, var(--abpl-m-teal)); }
#abpl-root .abpl-stat--grad { border: 0; }

/* ---------------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------------ */
#abpl-root .abpl-btn,
.abpl-auth .abpl-btn {
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  background: linear-gradient(135deg, var(--abpl-m-teal), var(--abpl-m-blue));
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--abpl-m-blue) 65%, transparent);
  transition: transform .18s var(--abpl-m-ease), box-shadow .18s, filter .18s;
}
#abpl-root .abpl-btn:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 14px 26px -10px color-mix(in srgb, var(--abpl-m-blue) 70%, transparent); }
#abpl-root .abpl-btn:active { transform: translateY(0) scale(.98); }
#abpl-root .abpl-btn--ghost {
  background: #fff;
  color: var(--abpl-m-blue);
  border: 1px solid color-mix(in srgb, var(--abpl-m-blue) 25%, #fff);
  box-shadow: none;
}
#abpl-root .abpl-btn--ghost:hover { background: color-mix(in srgb, var(--abpl-m-blue) 6%, #fff); box-shadow: none; }
#abpl-root .abpl-btn--success { background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 8px 18px -8px rgba(22, 163, 74, .6); }
#abpl-root .abpl-btn--danger  { background: linear-gradient(135deg, #dc2626, #f43f5e); box-shadow: 0 8px 18px -8px rgba(220, 38, 38, .55); }
#abpl-root .abpl-btn--sm { border-radius: 11px; }

/* ---------------------------------------------------------------------------
 * Forms
 * ------------------------------------------------------------------------ */
#abpl-root .abpl-input,
#abpl-root .abpl-select,
#abpl-root textarea.abpl-input,
.abpl-auth .abpl-input {
  border-radius: 14px;
  border: 1.5px solid #e1e6f2;
  background: #fbfcff;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
#abpl-root .abpl-input:focus,
#abpl-root .abpl-select:focus,
.abpl-auth .abpl-input:focus {
  outline: 0;
  background: #fff;
  border-color: var(--abpl-m-blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--abpl-m-blue) 16%, transparent);
}
#abpl-root .abpl-label { font-weight: 700; color: #3a4663; }

/* ---------------------------------------------------------------------------
 * Tables, badges, tabs, progress
 * ------------------------------------------------------------------------ */
#abpl-root .abpl-table-wrap { border-radius: var(--abpl-m-radius-sm); }
#abpl-root .abpl-table th {
  background: linear-gradient(180deg, #f6f8fe, #f1f4fc);
  color: #5a6784;
  border-bottom: 0;
}
#abpl-root .abpl-table th:first-child { border-top-left-radius: 12px; }
#abpl-root .abpl-table th:last-child  { border-top-right-radius: 12px; }
#abpl-root .abpl-table tbody tr { transition: background .15s; }
#abpl-root .abpl-table tbody tr:hover { background: color-mix(in srgb, var(--abpl-m-blue) 5%, #fff); }
#abpl-root .abpl-table td { border-bottom: 1px solid #eef1f8; }

#abpl-root .abpl-badge { font-weight: 700; padding: 4px 11px; }
#abpl-root .abpl-badge--success { background: #dcfce7; color: #15803d; }
#abpl-root .abpl-badge--warning { background: #fef3c7; color: #b45309; }
#abpl-root .abpl-badge--danger  { background: #ffe4e6; color: #be123c; }
#abpl-root .abpl-badge--info    { background: #e0e7ff; color: #4338ca; }

#abpl-root .abpl-tabs { border-bottom: 0; gap: 6px; padding: 5px; background: #eef1fa; border-radius: 16px; width: fit-content; max-width: 100%; }
#abpl-root .abpl-tabs button,
#abpl-root .abpl-tabs a { border: 0; border-radius: 12px; padding: 8px 16px; transition: background .15s, color .15s, box-shadow .15s; }
#abpl-root .abpl-tabs button.is-active,
#abpl-root .abpl-tabs a.is-active { background: #fff; color: var(--abpl-m-blue); box-shadow: 0 4px 12px -4px rgba(30, 41, 90, .25); }

#abpl-root .abpl-progress { height: 10px; background: #e9edf8; }
#abpl-root .abpl-progress__bar { background: linear-gradient(90deg, var(--abpl-m-teal), var(--abpl-m-blue), var(--abpl-m-violet)); }

#abpl-root .abpl-alert { border-radius: 16px; border: 0; box-shadow: var(--abpl-m-shadow); }

#abpl-root .abpl-modal__panel,
#abpl-root .abpl-modal-box,
#abpl-root .abpl-modal__dialog { border-radius: 24px; box-shadow: 0 30px 80px -20px rgba(30, 41, 90, .45); }

/* ---------------------------------------------------------------------------
 * Page-enter motion (respects reduced motion)
 * ------------------------------------------------------------------------ */
@keyframes abpl-m-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
#abpl-root .abpl-content > * { animation: abpl-m-rise .38s var(--abpl-m-ease) both; }
#abpl-root .abpl-content > *:nth-child(2) { animation-delay: .04s; }
#abpl-root .abpl-content > *:nth-child(3) { animation-delay: .08s; }
#abpl-root .abpl-content > *:nth-child(4) { animation-delay: .12s; }
@media (prefers-reduced-motion: reduce) {
  #abpl-root .abpl-content > * { animation: none; }
  #abpl-root .abpl-stat:hover,
  #abpl-root .abpl-btn:hover,
  #abpl-root .abpl-nav-link:hover { transform: none; }
}

/* ---------------------------------------------------------------------------
 * Mobile bottom navigation (app-style) — hidden on desktop
 * ------------------------------------------------------------------------ */
.abpl-bottomnav { display: none; }

@media (max-width: 960px) {
  .abpl-bottomnav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    height: var(--abpl-m-bottomnav-h);
    padding: 6px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    backdrop-filter: saturate(180%) blur(16px);
    border: 1px solid rgba(30, 41, 90, .07);
    border-radius: 24px;
    box-shadow: 0 18px 40px -12px rgba(30, 41, 90, .35);
  }
  .abpl-bottomnav__item {
    appearance: none;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 4px 2px;
    border-radius: 18px;
    color: #7b86a0;
    font: inherit;
    font-size: .66rem;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .2s var(--abpl-m-ease), color .2s, transform .2s var(--abpl-m-ease);
  }
  .abpl-bottomnav__item svg { transition: transform .2s var(--abpl-m-ease); }
  .abpl-bottomnav__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .66rem; font-weight: 700; line-height: 1.1; color: inherit; }
  .abpl-bottomnav__item:active { transform: scale(.94); }
  .abpl-bottomnav__item.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--abpl-m-teal), var(--abpl-m-blue));
    box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--abpl-m-blue) 80%, transparent);
  }
  .abpl-bottomnav__item.is-active svg { transform: translateY(-1px) scale(1.08); }

  /* keep content clear of the floating bar */
  #abpl-root .abpl-content { padding-bottom: calc(var(--abpl-m-bottomnav-h) + 34px + env(safe-area-inset-bottom, 0px)); }
  #abpl-root .abpl-footer { padding-bottom: calc(var(--abpl-m-bottomnav-h) + 26px); }
  body.abpl-mobile-menu-open .abpl-bottomnav { display: none; }

  /* the drawer becomes a rounded sheet from the left */
  #abpl-root .abpl-sidebar { border-radius: 0 28px 28px 0; }
  #abpl-root .abpl-scrim { background: rgba(20, 26, 60, .45); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  #abpl-root .abpl-panel,
  #abpl-root .abpl-stat { border-radius: 18px; }
}

@media (max-width: 520px) {
  #abpl-root .abpl-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  #abpl-root .abpl-tabs::-webkit-scrollbar { display: none; }
  #abpl-root .abpl-tabs button,
  #abpl-root .abpl-tabs a { white-space: nowrap; }
}

/* Wide desktops: give cards a little more air */
@media (min-width: 1500px) {
  #abpl-root .abpl-content { max-width: 1680px; margin-inline: auto; }
}

/* ---------------------------------------------------------------------------
 * Login / auth screens
 * ------------------------------------------------------------------------ */
.abpl-auth {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(520px 420px at 12% 18%, rgba(34, 211, 238, .55), transparent 62%),
    radial-gradient(560px 460px at 90% 12%, rgba(167, 139, 250, .6), transparent 62%),
    radial-gradient(600px 500px at 80% 92%, rgba(244, 114, 182, .45), transparent 62%),
    radial-gradient(520px 420px at 8% 92%, rgba(251, 191, 36, .4), transparent 62%),
    linear-gradient(150deg, #1e3a8a 0%, #4338ca 45%, #0f766e 100%);
  background-attachment: fixed;
}
.abpl-auth::before,
.abpl-auth::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, .09);
  animation: abpl-m-float 14s ease-in-out infinite;
}
.abpl-auth::before { width: 340px; height: 340px; top: -90px; left: -80px; }
.abpl-auth::after  { width: 260px; height: 260px; bottom: -70px; right: -50px; animation-delay: -6s; }
@keyframes abpl-m-float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, -22px); } }

.abpl-auth__card {
  z-index: 1;
  width: min(460px, 100%);
  border: 0;
  border-radius: 32px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 40px 90px -24px rgba(15, 23, 80, .55);
}
.abpl-auth__card::before {
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 32px 32px 0 0;
  background: linear-gradient(90deg, #22d3ee, var(--abpl-m-blue, #2563eb), var(--abpl-m-violet), var(--abpl-m-pink));
}
.abpl-auth__mark {
  background: linear-gradient(135deg, var(--abpl-m-teal, #0f766e), var(--abpl-m-blue, #2563eb));
  color: #fff;
  box-shadow: 0 14px 28px -10px rgba(37, 99, 235, .6);
}
.abpl-auth__title { font-weight: 800; letter-spacing: -.02em; }
.abpl-auth .abpl-input { width: 100%; box-sizing: border-box; min-height: 50px; padding: 12px 16px; font-size: 1rem; }
.abpl-auth .abpl-btn--block { display: inline-flex; align-items: center; justify-content: center; width: 100%; box-sizing: border-box; color: #fff; border: 0; cursor: pointer; }
.abpl-auth__mark { font-size: .95rem; width: 64px; height: 64px; border-radius: 20px; text-transform: uppercase; overflow: hidden; }
.abpl-auth .abpl-btn { min-height: 52px; border-radius: 16px; font-size: 1rem; }
.abpl-auth__link { color: var(--abpl-m-blue, #2563eb); font-weight: 700; }

@media (max-width: 520px) {
  .abpl-auth { padding: 18px 14px; align-items: flex-end; min-height: 100dvh; }
  .abpl-auth__card { padding: 30px 22px 26px; border-radius: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .abpl-auth::before, .abpl-auth::after { animation: none; }
}

/* ===========================================================================
 * PHASE 2 — every remaining portal component (all pages, all roles)
 * ======================================================================== */

/* ---- Shared card surfaces ------------------------------------------------ */
#abpl-root .abpl-stat-card,
#abpl-root .abpl-summary-card,
#abpl-root .abpl-info-card,
#abpl-root .abpl-form-section,
#abpl-root .abpl-field-section,
#abpl-root .abpl-dashboard-card,
#abpl-root .abpl-dashboard-section,
#abpl-root .abpl-glance-card,
#abpl-root .abpl-alert-chip,
#abpl-root .abpl-invest-panel,
#abpl-root .abpl-empty {
  border-radius: var(--abpl-m-radius);
  border-color: rgba(30, 41, 90, .07);
}
#abpl-root .abpl-stat-card,
#abpl-root .abpl-summary-card,
#abpl-root .abpl-info-card,
#abpl-root .abpl-dashboard-card,
#abpl-root .abpl-glance-card,
#abpl-root .abpl-alert-chip {
  background: #fff;
  box-shadow: var(--abpl-m-shadow);
  transition: transform .22s var(--abpl-m-ease), box-shadow .22s;
}
#abpl-root .abpl-stat-card:hover,
#abpl-root .abpl-summary-card:hover,
#abpl-root .abpl-glance-card:hover,
#abpl-root .abpl-alert-chip:hover { transform: translateY(-3px); box-shadow: var(--abpl-m-shadow-hover); }
#abpl-root .abpl-form-section,
#abpl-root .abpl-field-section {
  background: linear-gradient(180deg, #fff, #fbfcff);
  box-shadow: 0 1px 2px rgba(30, 41, 90, .04);
}
#abpl-root .abpl-dashboard-section {
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--abpl-m-shadow);
}
#abpl-root .abpl-empty {
  background: linear-gradient(180deg, #fbfcff, #f3f6fd);
  border: 2px dashed color-mix(in srgb, var(--abpl-m-blue) 22%, #fff);
}

/* ---- KPI stat cards: accent strip + coloured icon, cycling --------------- */
#abpl-root .abpl-stat-grid > .abpl-stat-card,
#abpl-root .abpl-stat-grid > .abpl-stat:not(.abpl-stat--grad),
#abpl-root .abpl-summary-cards > .abpl-summary-card,
#abpl-root .abpl-user-kpis > * {
  --m-acc: var(--abpl-m-teal);
  position: relative;
  background:
    radial-gradient(150px 110px at 100% 0%, color-mix(in srgb, var(--m-acc) 14%, transparent), transparent 70%),
    #fff;
  border-top: 4px solid var(--m-acc);
}
#abpl-root .abpl-stat-grid > :nth-child(6n+2),
#abpl-root .abpl-summary-cards > :nth-child(6n+2),
#abpl-root .abpl-user-kpis > :nth-child(6n+2) { --m-acc: var(--abpl-m-blue); }
#abpl-root .abpl-stat-grid > :nth-child(6n+3),
#abpl-root .abpl-summary-cards > :nth-child(6n+3),
#abpl-root .abpl-user-kpis > :nth-child(6n+3) { --m-acc: var(--abpl-m-violet); }
#abpl-root .abpl-stat-grid > :nth-child(6n+4),
#abpl-root .abpl-summary-cards > :nth-child(6n+4),
#abpl-root .abpl-user-kpis > :nth-child(6n+4) { --m-acc: var(--abpl-m-pink); }
#abpl-root .abpl-stat-grid > :nth-child(6n+5),
#abpl-root .abpl-summary-cards > :nth-child(6n+5),
#abpl-root .abpl-user-kpis > :nth-child(6n+5) { --m-acc: var(--abpl-m-amber); }
#abpl-root .abpl-stat-grid > :nth-child(6n),
#abpl-root .abpl-summary-cards > :nth-child(6n),
#abpl-root .abpl-user-kpis > :nth-child(6n) { --m-acc: var(--abpl-m-cyan); }

#abpl-root .abpl-stat-card__icon {
  width: 38px; height: 38px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--m-acc, var(--abpl-m-blue)) 14%, #fff);
  color: var(--m-acc, var(--abpl-m-blue));
}
#abpl-root .abpl-stat-card--green .abpl-stat-card__icon  { background: #dcfce7; color: #15803d; }
#abpl-root .abpl-stat-card--purple .abpl-stat-card__icon { background: #ede9fe; color: #6d28d9; }
#abpl-root .abpl-stat-card--orange .abpl-stat-card__icon { background: #ffedd5; color: #c2410c; }
#abpl-root .abpl-stat-card--cyan .abpl-stat-card__icon   { background: #cffafe; color: #0e7490; }
#abpl-root .abpl-stat-card--red .abpl-stat-card__icon    { background: #ffe4e6; color: #be123c; }
#abpl-root .abpl-stat-card__value,
#abpl-root .abpl-summary-card strong { font-weight: 800; letter-spacing: -.03em; }
#abpl-root .abpl-stat-card__label,
#abpl-root .abpl-summary-card span { font-weight: 700; color: #62708c; }

#abpl-root .abpl-tone-blue   { background: #e0e7ff; color: #4338ca; }
#abpl-root .abpl-tone-green  { background: #dcfce7; color: #15803d; }
#abpl-root .abpl-tone-purple { background: #ede9fe; color: #6d28d9; }

/* ---- Dashboard hero + quick actions -------------------------------------- */
#abpl-root .abpl-dashboard-hero,
#abpl-root .abpl-user-home-hero {
  position: relative;
  padding: clamp(16px, 2.4vw, 28px);
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(340px 220px at 92% 0%, rgba(255, 255, 255, .28), transparent 65%),
    radial-gradient(300px 220px at 0% 110%, rgba(236, 72, 153, .45), transparent 65%),
    linear-gradient(135deg, var(--abpl-m-teal), var(--abpl-m-blue) 55%, var(--abpl-m-violet));
  box-shadow: 0 24px 50px -22px color-mix(in srgb, var(--abpl-m-blue) 70%, transparent);
  overflow: hidden;
}
#abpl-root .abpl-dashboard-hero h1,
#abpl-root .abpl-user-home-hero h1,
#abpl-root .abpl-user-home-hero h2 { color: #fff; }
#abpl-root .abpl-dashboard-hero p,
#abpl-root .abpl-user-home-hero p { color: rgba(255, 255, 255, .86); }
#abpl-root .abpl-dashboard-hero .abpl-quick-action,
#abpl-root .abpl-dashboard-hero .abpl-btn--ghost {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: none;
}
#abpl-root .abpl-dashboard-hero .abpl-quick-action:hover { background: rgba(255, 255, 255, .3); }
#abpl-root .abpl-quick-action { border-radius: 14px; font-weight: 700; }
#abpl-root .abpl-eyebrow { font-weight: 800; letter-spacing: .08em; color: var(--abpl-m-violet); }
#abpl-root .abpl-dashboard-hero .abpl-eyebrow { color: rgba(255, 255, 255, .8); }

/* ---- Details / info grids ------------------------------------------------ */
#abpl-root .abpl-info__label { font-weight: 700; color: #7a86a1; letter-spacing: .02em; }
#abpl-root .abpl-info__value { font-weight: 700; color: #1d2744; }
#abpl-root .abpl-key-value-grid > div { border-bottom-color: #eef1f8; }
#abpl-root .abpl-detail-grid > *,
#abpl-root .abpl-info-grid > .abpl-info {
  background: #f8faff;
  border: 1px solid #eef1f9;
  border-radius: 14px;
  padding: 12px 14px;
}

/* ---- Filters, segmented controls, toggles -------------------------------- */
#abpl-root .abpl-filter-bar,
#abpl-root .abpl-filter-form {
  background: #fff;
  border: 1px solid rgba(30, 41, 90, .07);
  border-radius: var(--abpl-m-radius-sm);
  box-shadow: 0 1px 2px rgba(30, 41, 90, .04);
}
#abpl-root .abpl-segmented { border: 0; border-radius: 14px; background: #eef1fa; padding: 4px; gap: 4px; }
#abpl-root .abpl-segmented button { border-radius: 11px; background: transparent; font-weight: 700; }
#abpl-root .abpl-segmented button.is-active,
#abpl-root .abpl-seg-option.is-on {
  background: linear-gradient(135deg, var(--abpl-m-teal), var(--abpl-m-blue));
  color: #fff;
  box-shadow: 0 8px 16px -8px color-mix(in srgb, var(--abpl-m-blue) 70%, transparent);
}
#abpl-root .abpl-seg-option { border-radius: 12px; font-weight: 700; transition: background .18s, color .18s; }
#abpl-root .abpl-toggle-switch { background: #cdd5e6; transition: background .2s; }
#abpl-root .abpl-toggle-switch.is-on { background: linear-gradient(135deg, #22c55e, var(--abpl-m-teal)); }

/* ---- Notices, chips, status pills ---------------------------------------- */
#abpl-root .abpl-notice,
#abpl-root .abpl-notice-pending {
  border-radius: 16px;
  border: 0;
  box-shadow: 0 1px 2px rgba(30, 41, 90, .05);
}
#abpl-root .abpl-role-chip,
#abpl-root .abpl-perf-status { font-weight: 800; letter-spacing: .01em; }

/* ---- Popovers / menus ----------------------------------------------------- */
#abpl-root .abpl-notif,
#abpl-root .abpl-profile-menu {
  border: 1px solid rgba(30, 41, 90, .07);
  border-radius: 20px;
  box-shadow: 0 28px 60px -18px rgba(30, 41, 90, .4);
  animation: abpl-m-rise .2s var(--abpl-m-ease) both;
}
#abpl-root .abpl-notif__item { border-radius: 14px; }
#abpl-root .abpl-notif__item.is-unread { background: color-mix(in srgb, var(--abpl-m-blue) 7%, #fff); }
#abpl-root .abpl-profile-menu a { border-radius: 12px; }
#abpl-root .abpl-profile-menu a:hover { background: color-mix(in srgb, var(--abpl-m-blue) 8%, #fff); }
#abpl-root .abpl-avatar { box-shadow: 0 0 0 2px #fff, 0 6px 14px -6px rgba(30, 41, 90, .45); }

/* ---- Checkbox / radio accent --------------------------------------------- */
#abpl-root input[type="checkbox"],
#abpl-root input[type="radio"],
.abpl-auth input[type="checkbox"] { accent-color: var(--abpl-m-blue); }

/* ---- Hierarchy / tree / steps -------------------------------------------- */
#abpl-root .abpl-tree__node { border-radius: 16px; border-color: rgba(30, 41, 90, .08); box-shadow: 0 1px 2px rgba(30, 41, 90, .05); }
#abpl-root .abpl-steps__dot { background: linear-gradient(135deg, var(--abpl-m-teal), var(--abpl-m-blue)); color: #fff; border: 0; }

/* ---- Links ---------------------------------------------------------------- */
#abpl-root .abpl-link,
#abpl-root .abpl-table-link { color: var(--abpl-m-blue); font-weight: 700; }
#abpl-root .abpl-link:hover,
#abpl-root .abpl-table-link:hover { color: var(--abpl-m-violet); }

/* ---- Footer --------------------------------------------------------------- */
#abpl-root .abpl-footer { background: transparent; color: #8a94ab; border-top: 0; }

/* ---------------------------------------------------------------------------
 * Phones: card-stacked tables, touch-sized controls, no iOS focus-zoom
 * ------------------------------------------------------------------------ */
@media (max-width: 782px) {
  #abpl-root .abpl-table--cards tr {
    background: linear-gradient(180deg, #fff, #fbfcff);
    border: 1px solid rgba(30, 41, 90, .08);
    border-left: 4px solid var(--abpl-m-blue);
    border-radius: 18px;
    box-shadow: 0 6px 18px -10px rgba(30, 41, 90, .3);
    padding: 6px 16px;
    margin-bottom: 12px;
  }
  #abpl-root .abpl-table--cards tr:nth-child(3n+2) { border-left-color: var(--abpl-m-violet); }
  #abpl-root .abpl-table--cards tr:nth-child(3n)   { border-left-color: var(--abpl-m-teal); }
  #abpl-root .abpl-table--cards td { padding: 9px 0; border-bottom: 1px dashed #e6ebf5; }
  #abpl-root .abpl-table--cards td:last-child { border-bottom: 0; }
  #abpl-root .abpl-table--cards td::before { color: #7a86a1; font-weight: 700; text-transform: none; }
  #abpl-root .abpl-table--cards td[data-primary] { color: #1d2744; border-bottom: 1px solid #e6ebf5; }
  #abpl-root .abpl-table--cards tbody { background: transparent; }
  #abpl-root .abpl-table--cards tbody tr:hover { background: linear-gradient(180deg, #fff, #fbfcff); }
  #abpl-root .abpl-table-wrap { overflow: visible; }

  #abpl-root .abpl-input,
  #abpl-root .abpl-select,
  #abpl-root textarea.abpl-input,
  #abpl-root textarea.abpl-textarea { font-size: 16px; min-height: 48px; }
  #abpl-root .abpl-btn { min-height: 46px; }
  #abpl-root .abpl-btn--sm { min-height: 38px; }

  #abpl-root .abpl-dashboard-hero,
  #abpl-root .abpl-user-home-hero { border-radius: 22px; flex-direction: column; align-items: flex-start; }
  #abpl-root .abpl-filter-bar { padding: 12px; }
  #abpl-root .abpl-modal-box,
  #abpl-root .abpl-modal__panel,
  #abpl-root .abpl-modal__dialog { border-radius: 24px 24px 0 0; }
}

/* Tablets: tighter, denser grids so cards never look stretched */
@media (min-width: 783px) and (max-width: 1180px) {
  #abpl-root .abpl-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #abpl-root .abpl-content { padding-inline: 20px; }
}

#abpl-root .abpl-dashboard-hero .abpl-btn,
#abpl-root .abpl-dashboard-hero .abpl-btn--primary {
  background: #fff;
  color: var(--abpl-m-blue);
  box-shadow: 0 12px 24px -12px rgba(15, 23, 80, .55);
}
#abpl-root .abpl-dashboard-hero .abpl-btn:hover { filter: none; background: #f3f6ff; }

/* Phones: hero quick actions as a compact 2-column grid instead of a tall stack */
@media (max-width: 520px) {
  #abpl-root .abpl-dashboard-hero .abpl-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }
  #abpl-root .abpl-dashboard-hero .abpl-quick-action { justify-content: center; min-height: 44px; padding-inline: 8px; font-size: .78rem; }
}
