/* Shell Veritvs: sidebar + header estilo dashboard */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:root {
  --app-header-h: 56px;
  --app-sidebar-w: 268px;
  --app-sidebar-w-collapsed: 72px;
  --app-sidebar-bg: var(--color-background-paper);
  /* Header alinhado à cor do menu lateral */
  --app-header-bg: var(--app-sidebar-bg);
  /* Campos do header — cinza escuro no dark, texto claro */
  --app-header-field-bg: #2a3036;
  --app-header-field-border: #3d454e;
  --app-header-field-text: #e8eaed;
  --app-header-field-placeholder: #8b939e;
  --app-header-field-focus-ring: rgba(232, 234, 237, 0.14);
}

/* html[data-theme] — o tema fica no <html> (script inicial); evita chrome claro com texto claro */
html[data-theme="light"] {
  --app-shell-chrome-border: rgba(0, 0, 0, 0.24);
  --app-sidebar-bg: #3d4349;
  --app-header-bg: #3d4349;
  --app-header-field-bg: #dfe3e8;
  --app-header-field-border: #b8c0ca;
  --app-header-field-text: #1a1f26;
  --app-header-field-placeholder: #5c6570;
  --app-header-field-focus-ring: rgba(26, 72, 159, 0.18);
}

html[data-theme="light"] .app-sidebar {
  background-color: #3d4349;
  border-right-color: var(--app-shell-chrome-border);
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .app-sidebar__toolbar {
  border-bottom-color: var(--app-shell-chrome-border);
}

html[data-theme="light"] .app-top-header {
  background-color: #3d4349;
  border-bottom-color: var(--app-shell-chrome-border);
  color: rgba(255, 255, 255, 0.94);
}

html[data-theme="light"] .app-top-header__logo .logo-text {
  color: #ffffff;
}

html[data-theme="light"] .app-main-area > .site-footer {
  background-color: #3d4349;
  border-top-color: var(--app-shell-chrome-border);
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .app-main-area > .site-footer a {
  color: rgba(255, 255, 255, 0.95) !important;
}

html[data-theme="light"] .app-nav-link {
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .app-nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .app-sidebar__hamburger {
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .app-sidebar__hamburger:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] .app-header-notify {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.35);
}

html[data-theme="light"] .app-header-notify:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .app-header-avatar {
  border-color: rgba(255, 255, 255, 0.45);
}

html[data-theme="light"] button.app-header-avatar--btn {
  color: rgba(255, 255, 255, 0.9);
}

/* Dropdown do utilizador: mesmo cromado do header em light e dark; logout em vermelho */
html[data-theme="light"] .app-header-user-dropdown {
  background-color: var(--app-header-bg);
  border: 1px solid var(--app-shell-chrome-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] .app-header-user-dropdown__item {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .app-header-user-dropdown__item:hover,
html[data-theme="light"] .app-header-user-dropdown__item:focus-visible {
  background-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .app-header-user-dropdown__item--danger {
  color: var(--color-primary-highlight);
}

html[data-theme="light"] .app-header-user-dropdown__item--danger:hover,
html[data-theme="light"] .app-header-user-dropdown__item--danger:focus-visible {
  background-color: rgba(181, 38, 38, 0.12);
}

html[data-theme="light"] .app-header-selector select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c6570' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

body.app-shell-body {
  margin: 0;
  min-height: 100vh;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.app-sidebar {
  flex-shrink: 0;
  width: var(--app-sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  align-self: flex-start;
  background-color: var(--app-sidebar-bg);
  border-right: 1px solid var(--color-border-dark);
  display: flex;
  flex-direction: column;
  transition: width 0.28s ease-out;
  z-index: 10002;
}

.app-sidebar--collapsed {
  width: var(--app-sidebar-w-collapsed);
}

.app-sidebar__toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: var(--app-header-h);
  min-height: var(--app-header-h);
  max-height: var(--app-header-h);
  padding: 0 10px;
  border-bottom: none;
  box-sizing: border-box;
}

.app-sidebar--collapsed .app-sidebar__toolbar {
  justify-content: center;
  padding-left: 6px;
  padding-right: 6px;
}

.app-sidebar__hamburger {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--color-border-dark);
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
  position: relative;
}

/* Menu aberto (expandido): seta à esquerda = “feche/recolha”. Menu fechado: hambúrguer = “abra”. */
.app-sidebar-toggle__graphic {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.app-sidebar__hamburger[aria-expanded="true"] .app-sidebar-toggle__graphic--menu {
  display: none;
}

.app-sidebar__hamburger[aria-expanded="false"] .app-sidebar-toggle__graphic--collapse {
  display: none;
}

.app-sidebar__hamburger:hover {
  border-color: var(--color-border-light);
  background-color: rgba(255, 255, 255, 0.06);
}

.app-sidebar__inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-sidebar__nav--main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 10px 12px;
}

.app-sidebar__nav--footer {
  flex-shrink: 0;
  padding: 10px 10px 20px;
  border-top: none;
  align-items: stretch;
}

/* Linha só entre ícones sociais e Logout (não por cima dos ícones) */
.app-sidebar__footer-sep {
  border: 0;
  margin: 0 8px 12px;
  border-top: 1px solid var(--color-border-dark);
}

html[data-theme="light"] .app-sidebar__footer-sep {
  border-top-color: var(--app-shell-chrome-border);
}

/* Links externos (LinkedIn, YouTube, GitHub, site) acima do Logout */
.app-sidebar__social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
  margin: 0;
  padding: 0 6px 12px;
  list-style: none;
  box-sizing: border-box;
}

.app-sidebar__social li {
  margin: 0;
  padding: 0;
}

.app-sidebar__social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: color 0.2s ease-out, background-color 0.2s ease-out;
}

.app-sidebar__social-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.app-sidebar__social-link:focus-visible {
  outline: 2px solid var(--color-primary-accent);
  outline-offset: 2px;
}

.app-sidebar__social-link svg {
  flex-shrink: 0;
  display: block;
}

.app-sidebar__social-svg--fill,
.app-sidebar__social-link--linkedin svg {
  fill: currentColor;
  stroke: none;
}

.app-sidebar--collapsed .app-sidebar__social {
  gap: 5px 8px;
  padding-left: 4px;
  padding-right: 4px;
  padding-bottom: 10px;
}

.app-sidebar--collapsed .app-sidebar__social-link {
  width: 30px;
  height: 30px;
}

.app-sidebar--collapsed .app-sidebar__social-link svg {
  width: 17px;
  height: 17px;
}

.app-sidebar--collapsed .app-sidebar__footer-sep {
  margin-left: 6px;
  margin-right: 6px;
  margin-bottom: 10px;
}

html[data-theme="light"] .app-sidebar__social-link {
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .app-sidebar__social-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
}

/* Logout: largura da faixa do rodapé do menu, texto centrado (alinhado ao bloco do footer). */
.app-sidebar__nav--footer .app-nav-link--sidebar-logout {
  width: 100%;
  max-width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

.app-sidebar--collapsed .app-nav-link--sidebar-logout {
  justify-content: center;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.app-nav-link:hover {
  color: var(--color-text-primary);
  background-color: var(--color-background-elevated);
}

.app-nav-link--active {
  color: var(--color-text-inverse-light);
  background-color: var(--color-primary-accent);
}

.app-nav-link--active:hover {
  color: var(--color-text-inverse-light);
  background-color: var(--color-primary-accent);
  filter: brightness(1.05);
}

.app-nav-link__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.app-nav-link__icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

.app-nav-link__text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar--collapsed .app-nav-link {
  justify-content: center;
  padding: 11px 8px;
}

.app-sidebar--collapsed .app-nav-link__text {
  display: none;
}

/* Admin: grupo expansível no menu lateral */
.app-sidebar__admin-group {
  margin-bottom: 2px;
}

.app-sidebar__admin-toggle {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  /* Não usar `font: inherit` — o shorthand anula o font-size de .app-nav-link no mesmo elemento. */
  font-family: inherit;
  text-align: left;
  box-sizing: border-box;
}

.app-sidebar__admin-toggle .app-nav-link__icon svg {
  fill: currentColor;
  stroke: none;
}

.app-sidebar__admin-toggle .app-nav-link__text {
  flex: 1;
  min-width: 0;
}

.app-sidebar__admin-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  opacity: 0.75;
  transition: transform 0.22s ease-out;
}

.app-sidebar__admin-group--open .app-sidebar__admin-chevron {
  transform: rotate(0deg);
}

.app-sidebar__admin-group:not(.app-sidebar__admin-group--open) .app-sidebar__admin-chevron {
  transform: rotate(-90deg);
}

.app-sidebar__admin-children {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 8px 6px;
  margin-left: 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .app-sidebar__admin-children {
  border-left-color: rgba(255, 255, 255, 0.2);
}

/* Cromado escuro no light: subitens Admin como os restantes links (texto branco) */
html[data-theme="light"] .app-sidebar__admin-sublink {
  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .app-sidebar__admin-sublink:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .app-sidebar__admin-sublink--active {
  color: #ffffff;
}

html[data-theme="light"] .app-sidebar__admin-sublink--active:hover {
  color: #ffffff;
}

.app-sidebar__admin-group--open .app-sidebar__admin-children {
  display: flex;
}

.app-sidebar__admin-sublink {
  display: block;
  padding: 8px 10px 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  line-height: 1.35;
  transition: background-color 0.18s ease-out, color 0.18s ease-out;
}

.app-sidebar__admin-sublink:hover {
  color: var(--color-text-primary);
  background-color: var(--color-background-elevated);
}

.app-sidebar__admin-sublink--active {
  color: var(--color-text-inverse-light);
  background-color: var(--color-primary-accent);
  box-shadow: inset 3px 0 0 rgba(0, 0, 0, 0.2);
}

.app-sidebar__admin-sublink--active:hover {
  color: var(--color-text-inverse-light);
  filter: brightness(1.05);
}

.app-sidebar--collapsed .app-sidebar__admin-children {
  display: none !important;
}

.app-sidebar--collapsed .app-sidebar__admin-chevron {
  display: none;
}

.app-sidebar--collapsed .app-sidebar__admin-toggle {
  justify-content: center;
  padding-left: 8px;
  padding-right: 8px;
}

.app-main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-left: var(--app-sidebar-w);
}

.app-sidebar--collapsed ~ .app-main-area {
  margin-left: var(--app-sidebar-w-collapsed);
}

.app-top-header {
  position: sticky;
  top: 0;
  z-index: 10001;
  height: var(--app-header-h);
  min-height: var(--app-header-h);
  max-height: var(--app-header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
  background-color: var(--app-header-bg);
  border-bottom: 1px solid var(--color-border-dark);
  box-sizing: border-box;
}

/* Footer da área principal: mesma superfície que a sidebar */
.app-main-area > .site-footer {
  background-color: var(--app-sidebar-bg);
  border-top: 1px solid var(--color-border-dark);
}

.app-top-header__end {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  min-width: 0;
  flex: 1;
  justify-content: flex-end;
}

.app-top-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 45px;
  text-decoration: none;
  margin-right: 4px;
  flex-shrink: 0;
}

.app-top-header__logo .logo-img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  flex-shrink: 0;
}

.app-top-header__logo .logo-text {
  font-family: "Roboto Slab", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.5px;
  line-height: 1;
}

.app-header-selector {
  position: relative;
  flex-shrink: 0;
}

.app-header-selector select,
.app-header-selector .app-header-selector__readonly {
  min-width: 160px;
  max-width: 220px;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--app-header-field-text);
  background-color: var(--app-header-field-bg);
  border: 1px solid var(--app-header-field-border);
  border-radius: 8px;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b939e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.app-header-selector .app-header-selector__readonly {
  background-image: none;
  padding-right: 12px;
}

.app-header-selector__readonly {
  display: inline-block;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
  line-height: 1.35;
}

.app-header-selector select:disabled {
  opacity: 1;
  cursor: default;
}

.app-header-selector select:focus,
.app-header-selector select:focus-visible,
.app-header-search input:focus,
.app-header-search input:focus-visible {
  outline: none;
  border-color: var(--app-header-field-border);
  box-shadow: 0 0 0 2px var(--app-header-field-focus-ring);
}

.app-header-search {
  flex: 0 1 300px;
  width: min(300px, 32vw);
  min-width: 140px;
  max-width: 360px;
  position: relative;
}

.app-header-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 14px 9px 38px;
  font-size: 13px;
  color: var(--app-header-field-text);
  background-color: var(--app-header-field-bg);
  border: 1px solid var(--app-header-field-border);
  border-radius: 8px;
}

.app-header-search input::placeholder {
  color: var(--app-header-field-placeholder);
}

.app-header-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--app-header-field-placeholder);
  pointer-events: none;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-header-notify-wrap {
  position: relative;
  flex-shrink: 0;
}

.app-header-notify {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--color-border-default);
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease-out, background-color 0.2s ease-out;
  -webkit-tap-highlight-color: transparent;
}

.app-header-notify:hover {
  border-color: var(--color-primary-accent);
  background-color: rgba(26, 72, 159, 0.1);
}

.app-header-notify:focus-visible {
  outline: 2px solid var(--color-primary-accent);
  outline-offset: 2px;
}

.app-header-notify__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #ffffff;
  background-color: var(--color-primary-highlight);
  box-shadow: 0 0 0 2px var(--app-header-bg, var(--color-background-paper));
  pointer-events: none;
}

.app-header-notify-panel {
  /* Superfície escura: botões não usam --color-background-paper (no light theme vira branco) */
  --np-title: rgba(255, 255, 255, 0.96);
  --np-btn-fg: rgba(255, 255, 255, 0.9);
  --np-btn-fg-hover: #ffffff;
  --np-btn-fill: rgba(255, 255, 255, 0.08);
  --np-btn-fill-hover: rgba(255, 255, 255, 0.14);
  --np-btn-fill-ghost: rgba(255, 255, 255, 0.04);
  --np-btn-border: rgba(255, 255, 255, 0.16);
  --np-btn-border-hover: rgba(130, 170, 255, 0.55);
  --np-btn-ring: rgba(130, 170, 255, 0.35);

  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(410px, calc(100vw - 24px));
  max-height: min(420px, 70vh);
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background-color: var(--app-sidebar-bg);
  border: 1px solid var(--color-border-dark);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 10050;
  overflow: hidden;
}

.app-header-notify-panel[hidden] {
  display: none !important;
}

.app-header-notify-panel__head {
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--color-border-dark);
}

.app-header-notify-panel__title-wrap {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

.app-header-notify-panel__title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--np-title);
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.app-header-notify-panel__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.app-header-notify-panel__btn {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  box-sizing: border-box;
  background-image: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border-style: solid;
  border-width: 1px;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.12s ease;
}

.app-header-notify-panel__btn-icon {
  flex-shrink: 0;
  opacity: 0.92;
}

.app-header-notify-panel__btn--mark {
  color: var(--np-btn-fg);
  background-color: var(--np-btn-fill);
  border-color: var(--np-btn-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.app-header-notify-panel__btn--mark:hover {
  color: var(--np-btn-fg-hover);
  background-color: var(--np-btn-fill-hover);
  border-color: var(--np-btn-border-hover);
  box-shadow: 0 0 0 1px var(--np-btn-ring), 0 4px 14px rgba(0, 0, 0, 0.28);
}

.app-header-notify-panel__btn--mark:focus-visible {
  outline: 2px solid var(--np-btn-border-hover);
  outline-offset: 2px;
}

.app-header-notify-panel__btn--mark:active {
  transform: scale(0.98);
}

/* Secundário: mais discreto que «Marcar lidas», mesmo alinhamento horizontal ao título */
.app-header-notify-panel__btn--history {
  color: var(--np-btn-fg);
  background-color: var(--np-btn-fill-ghost);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.app-header-notify-panel__btn--history:hover {
  color: var(--np-btn-fg-hover);
  background-color: var(--np-btn-fill);
  border-color: var(--np-btn-border-hover);
  box-shadow: 0 0 0 1px var(--np-btn-ring);
}

.app-header-notify-panel__btn--history:focus-visible {
  outline: 2px solid var(--np-btn-border-hover);
  outline-offset: 2px;
}

.app-header-notify-panel__btn--history:active {
  transform: scale(0.98);
}

.app-header-notify-panel__body {
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.app-header-notify-panel__list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.app-header-notify-panel__item {
  margin: 0;
  border-bottom: 1px solid var(--color-border-dark);
}

.app-header-notify-panel__item:last-child {
  border-bottom: none;
}

.app-header-notify-panel__link {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease-out;
}

.app-header-notify-panel__link:hover,
.app-header-notify-panel__link:focus-visible {
  background-color: var(--color-background-elevated);
  outline: none;
}

.app-header-notify-panel__item-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 4px;
}

.app-header-notify-panel__item-body {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.app-header-notify-panel__item-time {
  display: block;
  font-size: 11px;
  color: var(--color-text-disabled);
}

.app-header-notify-panel__item-cta {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary-accent);
}

.app-header-notify-panel__item:not(.app-header-notify-panel__item--clickable) {
  padding: 12px 16px;
}

.app-header-notify-panel__item:not(.app-header-notify-panel__item--clickable) .app-header-notify-panel__item-body {
  margin-bottom: 6px;
}

.app-header-notify-panel__empty {
  margin: 0;
  padding: 20px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  text-align: center;
}

/* Light: painel de notificações no chrome — após regras base para vencer na cascata */
html[data-theme="light"] .app-header-notify-panel {
  background-color: var(--app-header-bg);
  border: 1px solid var(--app-shell-chrome-border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] .app-header-notify-panel__head {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .app-header-notify-panel__title {
  color: var(--np-title);
}

html[data-theme="light"] .app-header-notify-panel__item {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .app-header-notify-panel__item-title {
  color: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .app-header-notify-panel__item-body {
  color: rgba(255, 255, 255, 0.78);
}

html[data-theme="light"] .app-header-notify-panel__item-time {
  color: rgba(255, 255, 255, 0.55);
}

html[data-theme="light"] .app-header-notify-panel__item-cta {
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="light"] .app-header-notify-panel__link:hover .app-header-notify-panel__item-title,
html[data-theme="light"] .app-header-notify-panel__link:focus-visible .app-header-notify-panel__item-title {
  color: #ffffff;
}

html[data-theme="light"] .app-header-notify-panel__empty {
  color: rgba(255, 255, 255, 0.65);
}

html[data-theme="light"] .app-header-notify-panel__link:hover,
html[data-theme="light"] .app-header-notify-panel__link:focus-visible {
  background-color: rgba(255, 255, 255, 0.12);
}

.app-header-user-wrap {
  position: relative;
  flex-shrink: 0;
}

.app-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-border-default);
  flex-shrink: 0;
  background: var(--color-background-paper);
  display: flex;
  align-items: center;
  justify-content: center;
}

button.app-header-avatar--btn {
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button.app-header-avatar--btn:focus-visible {
  outline: 2px solid var(--color-primary-accent);
  outline-offset: 2px;
}

.app-header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  padding: 6px 0;
  margin: 0;
  background-color: var(--app-sidebar-bg);
  border: 1px solid var(--color-border-dark);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 10050;
}

.app-header-user-dropdown__item {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: background-color 0.15s ease-out;
}

.app-header-user-dropdown__item:hover,
.app-header-user-dropdown__item:focus-visible {
  background-color: var(--color-background-elevated);
  outline: none;
}

.app-header-user-dropdown__item--danger {
  color: var(--color-primary-highlight);
}

.app-header-user-dropdown__item--danger:hover,
.app-header-user-dropdown__item--danger:focus-visible {
  background-color: rgba(181, 38, 38, 0.12);
}

.app-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-header-avatar__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-text-secondary);
}

.app-header-avatar__placeholder svg {
  flex-shrink: 0;
}

.app-content {
  flex: 1;
  padding: 24px 20px 40px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.app-shell-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000;
}

.app-shell-backdrop--visible {
  display: block;
}

@media (min-width: 961px) {
  .app-sidebar--collapsed {
    width: var(--app-sidebar-w-collapsed);
  }
}

@media (max-width: 960px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--app-sidebar-w) !important;
    transform: translateX(-100%);
    transition: transform 0.28s ease-out;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.35);
  }

  .app-sidebar.app-sidebar--mobile-open {
    transform: translateX(0);
  }

  .app-main-area {
    width: 100%;
    margin-left: 0;
  }

  .app-top-header__logo .logo-text {
    display: none;
  }

  .app-top-header {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--app-header-h);
    max-height: none;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .app-top-header__end {
    flex-basis: 100%;
    margin-left: 0;
    justify-content: flex-end;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .app-header-search {
    flex: 1 1 200px;
    width: auto;
    max-width: none;
    min-width: 0;
  }
}

/* Conteúdo central: preto (dark) / branco (light) — independente do azul #081023 */
.app-main-area .app-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

html[data-theme="dark"] .app-main-area .app-content {
  background-color: #000000;
  color: rgba(255, 255, 255, 0.94);
}

html[data-theme="light"] .app-main-area .app-content {
  background-color: #ffffff;
  color: #111111;
}

html[data-theme="light"] .app-main-area .app-content h1,
html[data-theme="light"] .app-main-area .app-content h2,
html[data-theme="light"] .app-main-area .app-content h3,
html[data-theme="light"] .app-main-area .app-content h4,
html[data-theme="light"] .app-main-area .app-content p,
html[data-theme="light"] .app-main-area .app-content li {
  color: #111111;
}

html[data-theme="dark"] body.app-shell-body {
  background-color: #000000;
}

html[data-theme="light"] body.app-shell-body {
  background-color: #ffffff;
}

/* Mensagens Django (perfil / configurações) */
.portal-messages {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  max-width: 520px;
}

.portal-messages__item {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.portal-messages__item--success {
  background-color: rgba(76, 175, 80, 0.18);
  color: var(--color-text-primary);
  border: 1px solid rgba(76, 175, 80, 0.35);
}

.portal-messages__item--error {
  background-color: rgba(181, 38, 38, 0.15);
  color: var(--color-text-primary);
  border: 1px solid rgba(181, 38, 38, 0.35);
}

.portal-messages__item--warning {
  background-color: rgba(255, 152, 0, 0.15);
  border: 1px solid rgba(255, 152, 0, 0.35);
}

/* Páginas conta (perfil / configurações) */
.account-page {
  max-width: 440px;
  margin: 0 auto;
  padding: 8px 0 32px;
}

.account-page__title {
  font-family: "Roboto Slab", serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 24px;
  text-align: center;
}

.account-page--profile {
  max-width: 480px;
}

.account-page__avatar-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.account-page__avatar-hit {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border-radius: 16px;
  padding: 12px 12px 8px;
  outline: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.account-page__avatar-hit:hover {
  background-color: var(--color-background-elevated);
}

.account-page__avatar-hit:focus-visible {
  box-shadow: 0 0 0 3px var(--color-primary-accent, #1a489f);
}

.account-page__avatar-ring {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-border-default);
  background: var(--color-background-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-page__avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-page__avatar-preview-img[hidden] {
  display: none !important;
}

.account-page__avatar-placeholder {
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.account-page__avatar-placeholder[hidden] {
  display: none !important;
}

.account-page__avatar-hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 280px;
  line-height: 1.4;
}

.account-page__avatar-file-slot {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.account-page__field--remove-photo {
  margin-top: 8px;
  text-align: center;
}

.account-page__remove-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-primary);
}

.account-page__errors--center {
  text-align: center;
  margin-top: 8px;
}

.account-page__field {
  margin-bottom: 16px;
}

.account-page__field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.account-page__field input[type="text"],
.account-page__field input[type="file"],
.account-page__field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border-default);
  background: var(--color-background-paper);
  color: var(--color-text-primary);
  font-size: 14px;
}

.account-page__actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.account-page__btn {
  min-width: 160px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: var(--color-primary-accent, #1a489f);
  color: #fff;
}

.account-page__btn:hover {
  filter: brightness(1.08);
}

.account-page__errors {
  color: var(--color-feedback-error, #b52626);
  font-size: 13px;
  margin: 4px 0 0;
}

.account-settings__fieldset {
  border: 1px solid var(--color-border-default);
  border-radius: 10px;
  padding: 16px 18px 20px;
  margin-bottom: 18px;
  background: var(--color-background-paper);
}

.account-settings__fieldset legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  padding: 0 8px;
}

.account-settings__widget-wrap ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-settings__widget-wrap li {
  margin: 10px 0;
}

.account-settings__widget-wrap label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-primary);
}

.account-settings__checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary-accent, #1a489f);
}

html[data-theme="light"] .account-page__title {
  color: #111;
}

/*
 * Faixas com scroll horizontal sem barra nativa (home: Clientes, Setor; navegação por setas ou toque).
 * scroll-snap e margens ficam no template que usa a classe.
 */
.portal-cards-scroller {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.portal-cards-scroller::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Reutilizável em outros templates com overflow-x: auto */
.portal-scroll-x-no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.portal-scroll-x-no-scrollbar::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
