/* Shared graphite glass finish. Load after the dashboard module styles. */
:root {
  --av-glass-edge: rgba(237, 242, 250, .34);
  --av-glass-shine: rgba(255, 255, 255, .13);
  --av-glass-shadow: 0 10px 28px rgba(0, 0, 0, .23);
  --av-glass-focus: #ffe76a;
}

/* Gradients, not a separate blur layer for each button. */
:is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
  :is(.button, .icon-button):not(.av-pp-dialog *):not(:disabled):not([aria-disabled="true"]) {
  border-color: var(--av-glass-edge);
  background-image: linear-gradient(158deg, var(--av-glass-shine), transparent 43%, rgba(0, 0, 0, .12));
  box-shadow: inset 0 1px rgba(255, 255, 255, .17), 0 3px 10px rgba(0, 0, 0, .18);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}

:is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
  .button.primary:not(.danger):not(.av-pp-dialog *):not(:disabled):not([aria-disabled="true"]) {
  color: #171406;
  border-color: #fff09a;
  background-color: #ffda2d;
  background-image: linear-gradient(155deg, rgba(255, 255, 255, .57), rgba(255, 236, 108, .12) 43%, rgba(142, 102, 0, .2));
  box-shadow: inset 0 1px rgba(255, 255, 255, .78), 0 7px 18px rgba(0, 0, 0, .23);
  text-shadow: none;
}

:is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
  .button.danger:not(.av-pp-dialog *):not(:disabled):not([aria-disabled="true"]) {
  color: #ffd2d8;
  border-color: #d86b7b;
  background-color: #44212b;
  background-image: linear-gradient(156deg, rgba(255, 220, 226, .14), transparent 48%, rgba(0, 0, 0, .16));
  box-shadow: inset 0 1px rgba(255, 220, 226, .18), 0 5px 14px rgba(0, 0, 0, .22);
  text-shadow: none;
}

.button.primary.danger:not(.av-pp-dialog *)::after { display: none; }

@media (hover: hover) {
  :is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
    :is(.button, .icon-button):not(.av-pp-dialog *):not(:disabled):not([aria-disabled="true"]):hover {
    border-color: rgba(255, 255, 255, .7);
    filter: brightness(1.08);
  }
  :is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
    .button.danger:not(.av-pp-dialog *):not(:disabled):hover { border-color: #ffa8b5; }
}

:is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
  :is(.button, .icon-button):not(.av-pp-dialog *):focus-visible,
:is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
  button:not(.av-pp-dialog *):focus-visible {
  outline: 3px solid var(--av-glass-focus);
  outline-offset: 3px;
}

:is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
  :is(.button, .icon-button):not(.av-pp-dialog *):is(:disabled, [aria-disabled="true"]) {
  background-image: none;
  box-shadow: none;
  filter: none;
  opacity: .55;
  cursor: not-allowed;
}

/* Shared dialog shell: one composited glass layer; content stays fully opaque. */
.dialog:not(.av-pp-dialog),
dialog.forum-media-dialog:not(.av-pp-dialog):not(.av-photo-dialog),
dialog.idea-lightbox:not(.idea-media-expanded) {
  border-color: rgba(212, 221, 235, .43);
  background-color: #1c2027;
  color: #f5f5f7;
  box-shadow: inset 0 1px rgba(255, 255, 255, .16), 0 28px 74px rgba(0, 0, 0, .62);
}

.dialog:not(.av-pp-dialog) :is(.dialog-head, .dialog-foot),
.forum-media-dialog:not(.av-pp-dialog) .forum-media-heading,
.idea-lightbox:not(.idea-media-expanded) .idea-lightbox-head {
  border-color: rgba(222, 229, 241, .25);
  background-color: #2a303a;
  background-image: linear-gradient(158deg, rgba(255, 255, 255, .11), transparent 53%);
}

.dialog:not(.av-pp-dialog) .dialog-body { background-color: #1c2027; }

body dialog:not(.av-pp-dialog)::backdrop {
  background: rgba(2, 3, 5, .74);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Ações pendentes is an aside outside .app-shell, with its own scrim. */
.action-inbox-drawer {
  background: #25272b;
}
.action-inbox-drawer > header {
  background: #303239;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .dialog:not(.av-pp-dialog),
  dialog.forum-media-dialog:not(.av-pp-dialog):not(.av-photo-dialog),
  dialog.idea-lightbox:not(.idea-media-expanded) {
    background-color: rgba(30, 32, 38, .80);
    -webkit-backdrop-filter: blur(22px) saturate(1.12);
    backdrop-filter: blur(22px) saturate(1.12);
  }
  .dialog:not(.av-pp-dialog) :is(.dialog-head, .dialog-foot),
  .forum-media-dialog:not(.av-pp-dialog) .forum-media-heading,
  .idea-lightbox:not(.idea-media-expanded) .idea-lightbox-head {
    background-color: rgba(42, 44, 50, .68);
  }
  /* Do not stack a second opaque tint over the glass shell. */
  .dialog:not(.av-pp-dialog) .dialog-body { background-color: transparent; }

  body dialog:not(.av-pp-dialog)::backdrop {
    background: rgba(2, 3, 5, .46);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
  }

  .action-inbox-drawer {
    background: rgba(35, 37, 42, .86);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }
  .action-inbox-drawer > header { background: rgba(42, 44, 50, .8); }
}

/* The controls below are custom button families, separate from content media. */
.fll-community button:not(:disabled):not([aria-disabled="true"]),
.fll-admin-tabs button:not(:disabled),
.fll-account-tabs button:not(:disabled),
.app-shell .main-content :is(.segmented, .team-planner-views, .fll-tabs, .activity-view-options, .dialog-tabs) button:not(:disabled),
.app-shell .main-content :is(.document-export-tabs, .fll-lab-overview-tabs) button:not(:disabled),
.app-shell .app-topbar .topbar-tools .language button:not(:disabled),
.dialog:not(.av-pp-dialog) :is(.dialog-head, .dialog-foot) > button:not(.button):not(.icon-button):not(:disabled),
.forum-media-dialog:not(.av-pp-dialog) .forum-media-heading button:not(:disabled),
.idea-lightbox .idea-lightbox-close:not(:disabled) {
  background-image: linear-gradient(155deg, rgba(255, 255, 255, .12), transparent 49%, rgba(0, 0, 0, .12));
  box-shadow: inset 0 1px rgba(255, 255, 255, .15), 0 3px 10px rgba(0, 0, 0, .18);
}

.app-shell .sidebar-frame .side-nav button:is(:hover, [aria-current="page"]),
.app-shell .app-topbar .topbar-tools .language button[aria-pressed="true"] {
  background-image: linear-gradient(155deg, rgba(255, 255, 255, .13), transparent 56%);
  box-shadow: inset 0 1px rgba(255, 255, 255, .13);
}

.app-shell .main-content :is(.document-export-tabs, .fll-lab-overview-tabs) button[aria-selected="true"] {
  background-image: linear-gradient(155deg, rgba(255, 255, 255, .36), transparent 51%, rgba(112, 79, 0, .12));
  box-shadow: inset 0 1px rgba(255, 255, 255, .53), 0 3px 12px rgba(0, 0, 0, .2);
}

.app-shell .main-content :is(.segmented, .team-planner-views, .fll-tabs, .fll-admin-tabs, .fll-account-tabs, .activity-view-options, .dialog-tabs)
  button:is([aria-pressed="true"], [aria-selected="true"]) {
  color: #ffe778;
  border-color: #ac9142;
  background-color: #453b20;
  background-image: linear-gradient(158deg, rgba(255, 234, 147, .19), transparent 51%);
  box-shadow: inset 0 1px rgba(255, 248, 202, .2);
}

.fll-community button[aria-pressed="true"] {
  color: #ffe778;
  border-color: #ac9142;
  background-color: #453b20;
}

@media (max-width: 600px), (pointer: coarse) {
  :is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
    :is(.button, .icon-button):not(.av-pp-dialog *),
  .dialog:not(.av-pp-dialog) :is(.dialog-head, .dialog-foot) button,
  .forum-media-dialog:not(.av-pp-dialog) .forum-media-heading button,
  .idea-lightbox .idea-lightbox-close {
    min-height: max(2.75rem, 44px);
    min-width: max(2.75rem, 44px);
  }
  .app-shell .main-content :is(.button, .icon-button):not(.av-pp-dialog *) {
    min-height: max(3rem, 44px);
  }
  .dialog:not(.av-pp-dialog) { max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
}

html.av-phone-layout .app-shell .main-content :is(.button, .icon-button):not(.av-pp-dialog *) {
  min-height: max(3rem, 44px);
  min-width: max(2.75rem, 44px);
}

@media (prefers-reduced-transparency: reduce) {
  .dialog:not(.av-pp-dialog),
  dialog.forum-media-dialog:not(.av-pp-dialog),
  dialog.idea-lightbox:not(.idea-media-expanded) {
    background-color: #1c2027;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .dialog:not(.av-pp-dialog) :is(.dialog-head, .dialog-foot),
  .forum-media-dialog:not(.av-pp-dialog) .forum-media-heading,
  .idea-lightbox:not(.idea-media-expanded) .idea-lightbox-head {
    background-color: #2a303a;
  }
  .dialog:not(.av-pp-dialog) .dialog-body { background-color: #1c2027; }
  body dialog:not(.av-pp-dialog)::backdrop {
    background: rgba(2, 3, 5, .78);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .action-inbox-drawer {
    background: #25272b;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .action-inbox-drawer > header { background: #303239; }
  :is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
    :is(.button, .icon-button):not(.av-pp-dialog *) { background-image: none; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
    :is(.button, .icon-button):not(.av-pp-dialog *) { transition: none; animation: none; }
  :is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
    .button.primary:not(.av-pp-dialog *)::after { animation: none; display: none; }
}

@media print {
  :is(.app-shell, .dialog:not(.av-pp-dialog), .access-page, .forum-media-dialog:not(.av-pp-dialog), .idea-lightbox)
    :is(.button, .icon-button, .dialog-head, .dialog-foot, .dialog-body, .forum-media-heading, .idea-lightbox-head):not(.av-pp-dialog *),
  .app-shell :is(.side-nav button, .topbar-tools .language button),
  .app-shell .main-content :is(.segmented, .team-planner-views, .fll-tabs, .fll-admin-tabs, .fll-account-tabs, .activity-view-options, .dialog-tabs, .document-export-tabs, .fll-lab-overview-tabs) button,
  .fll-community button,
  .dialog:not(.av-pp-dialog),
  dialog.forum-media-dialog:not(.av-pp-dialog),
  dialog.idea-lightbox:not(.idea-media-expanded),
  .action-inbox-drawer,
  .action-inbox-drawer > header {
    background-color: transparent !important;
    background-image: none !important;
    color: #111 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  :is(.app-shell, .dialog:not(.av-pp-dialog)) .button.danger:not(.av-pp-dialog *) { color: #8f2535 !important; }
}

/* Keep the static glass surface without pointer-following edge refraction. */
.app-shell .main-content button.team-planner-event {
  background-image: linear-gradient(155deg, rgba(255, 255, 255, .12), transparent 55%) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .13), 0 3px 10px rgba(0, 0, 0, .2);
}
.app-shell .main-content button.team-planner-event.area-card {
  background-color: rgba(34, 37, 43, .84) !important;
}
@media (prefers-reduced-transparency: reduce) {
  .app-shell .main-content button.team-planner-event { background-image: none !important; }
  .app-shell .main-content button.team-planner-event.area-card { background-color: #25272b !important; }
}

/* Keep the first-team card stable; preserve its border transition. */
.app-shell .first-team-card { transition: border-color 160ms ease; }
.app-shell .first-team-card:hover { transform: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  .app-shell .first-team-card { transition: none; }
}
