﻿/* ============================================================================
   Portal do Colaborador - Design System
   Visual language: cool blue palette, white cards, deep navy sidebar,
   soft pastel blue accents and pill controls.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
   /* RCSoft blue palette */
   --color-1: #2196f3;
   --color-2: #6eb8f5;
   --color-3: #9acef8;
   --color-4: #c3e3fd;
   --color-5: #e8f5ff;

   --portal-primary: var(--color-1);
   --portal-primary-dark: #1565c0;
   --portal-primary-deep: #0d47a1;
   --portal-primary-soft: var(--color-4);
   --portal-primary-ghost: var(--color-5);
   --portal-black: #0b1b2b;
   --portal-black-soft: #14293d;
   --portal-bg: #dcebf9;
   --portal-shell: #f3f9ff;
   --portal-card: #ffffff;
   --portal-card-alt: #f7fbff;
   --portal-surface: #ffffff;
   --portal-surface-alt: #eff6fd;
   --portal-head-ink: #4a6b8a;
   --portal-disabled-surface: #dce8f5;
   --portal-news-ink: #4a4a4a;
   --portal-ink: #10243a;
   /* Contraste >= 4,5:1 sobre as superfícies claras do portal. */
   --portal-muted: #5c7288;
   --portal-line: #dbeafb;
   --portal-green: #2e9e52;
   --portal-green-soft: #e3f6e8;
   --portal-teal: #1e9aa0;
   --portal-blue: #2196f3;
   --portal-blue-soft: #c3e3fd;
   --portal-sand: #d6ecff;
   --portal-danger: #d94c4c;
   --radius-xl: 14px;
   --radius-lg: 10px;
   --radius-md: 8px;
   --radius-sm: 6px;
   --radius-pill: 999px;
   --shadow-soft: 0 12px 34px rgba(13, 71, 161, .10);
   --shadow-card: 0 6px 18px rgba(13, 71, 161, .07);
   --portal-sidebar-width: 268px;

   /* Cores derivadas da paleta em uso: acompanham automaticamente qualquer
      tema definido em /css/portal-paletas.css (--color-1). */
   --portal-shadow-primary: color-mix(in srgb, var(--portal-primary) 25%, transparent);
   --portal-shadow-primary-strong: color-mix(in srgb, var(--portal-primary) 35%, transparent);
   --portal-focus-ring: color-mix(in srgb, var(--portal-primary) 16%, transparent);
   --portal-tint-primary: color-mix(in srgb, var(--portal-primary) 12%, transparent);
   --portal-glow-primary: color-mix(in srgb, var(--portal-primary) 40%, transparent);
   --portal-ring-primary: color-mix(in srgb, var(--portal-primary) 10%, transparent);

   /* Fundo de acolhimento (login e destaque do dashboard).
      Azul da marca equilibrado: parte de um tom profundo da primária e
      clareia sem chegar ao preto nem estourar a cor. Deriva da paleta da
      empresa; o véu garante o contraste do texto claro. */
   --portal-hero-gradient:
      linear-gradient(180deg, rgba(6, 26, 43, .20) 0%, rgba(6, 26, 43, .28) 58%, rgba(6, 26, 43, .20) 100%),
      linear-gradient(155deg,
         color-mix(in srgb, var(--portal-primary) 32%, #0b1b2b) 0%,
         color-mix(in srgb, var(--portal-primary) 54%, #0b1b2b) 55%,
         color-mix(in srgb, var(--portal-primary) 72%, #0b1b2b) 100%);
   --portal-hero-gradient-alt:
      linear-gradient(100deg, rgba(6, 26, 43, .36) 0%, rgba(6, 26, 43, .12) 55%, rgba(6, 26, 43, 0) 85%),
      linear-gradient(120deg,
         color-mix(in srgb, var(--portal-primary) 34%, #0b1b2b) 0%,
         color-mix(in srgb, var(--portal-primary) 60%, #0b1b2b) 55%,
         color-mix(in srgb, var(--portal-primary) 82%, #0b1b2b) 100%);

   /* Keep legacy inline styles on brand */
   --accent: #1565c0;
   --accent-light: #2196f3;
}

html {
   height: 100%;
}

body,
body.portal-body {
   min-height: 100vh;
   margin: 0;
   padding: clamp(10px, 2vw, 30px);
   font-family: 'Plus Jakarta Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
   color: var(--portal-ink);
   background-color: #d8eaf9;
   background-image:
      radial-gradient(circle at 8% 4%, rgba(255, 255, 255, .7) 0, rgba(255, 255, 255, 0) 38%),
      radial-gradient(circle at 92% 96%, rgba(255, 255, 255, .6) 0, rgba(255, 255, 255, 0) 42%),
      linear-gradient(135deg, #e4f1fd 0%, #f5faff 45%, #d6e9f9 100%);
   background-attachment: fixed;
   -webkit-font-smoothing: antialiased;
}

body.portal-body::before {
   content: "";
   position: fixed;
   inset: 0;
   pointer-events: none;
   z-index: 0;
   opacity: .35;
   background-image: repeating-linear-gradient(135deg,
         rgba(255, 255, 255, .5) 0 1px,
         transparent 1px 26px);
}

h1, h2, h3, h4, h5, h6 {
   font-family: inherit;
   font-weight: 700;
   letter-spacing: -.01em;
   color: var(--portal-ink);
}

a {
   color: var(--portal-primary-dark);
   text-decoration: none;
}

   a:hover {
      color: var(--portal-primary);
   }

/* ---------------------------------------------------------------- shell --- */

/* The authenticated area occupies the whole viewport: no outer margin,
   no centered max-width and no rounded contour, so the sidebar sits flush
   against the page edges instead of looking like a centered card. */
body.portal-body:has(.portal-app) {
   padding: 0;
}

.portal-app {
   position: relative;
   z-index: 1;
   display: flex;
   max-width: none;
   min-height: 100vh;
   margin: 0;
   background: var(--portal-shell);
   border-radius: 0;
   box-shadow: none;
   overflow: visible;
}

.portal-main {
   display: flex;
   flex: 1 1 auto;
   min-width: 0;
   flex-direction: column;
   padding: 22px clamp(18px, 2.6vw, 40px) 0;
}

/* -------------------------------------------------------------- sidebar --- */

.portal-sidebar {
   position: sticky;
   top: 0;
   align-self: flex-start;
   display: flex;
   flex: 0 0 var(--portal-sidebar-width);
   width: var(--portal-sidebar-width);
   height: 100vh;
   height: 100dvh;
   min-height: 0;
   flex-direction: column;
   padding: 30px 18px 22px;
   color: #fff;
   background: var(--portal-black);
   border-radius: 0;
   transition: width .22s ease, flex-basis .22s ease;
}

.portal-sidebar.is-collapsed {
   flex-basis: 92px;
   width: 92px;
   padding-left: 14px;
   padding-right: 14px;
}

.portal-brand {
   display: flex;
   align-items: center;
   gap: 12px;
   min-height: 46px;
   padding: 4px 8px 0;
   margin-bottom: 26px;
   color: #fff;
   text-decoration: none;
}

   .portal-brand:hover,
   .portal-brand:focus-visible {
      color: #fff;
      text-decoration: none;
   }

.portal-brand-logo {
   display: block;
   flex: 0 0 auto;
   width: auto;
   height: 34px;
   max-width: 100%;
   object-fit: contain;
}

.portal-brand-wordmark {
   display: block;
   color: #fff;
   font-size: 23px;
   font-weight: 800;
   letter-spacing: -.045em;
   line-height: 1;
   white-space: nowrap;
}

.portal-sidebar.is-collapsed .portal-brand {
   justify-content: center;
   padding-left: 0;
   padding-right: 0;
}

.portal-sidebar.is-collapsed .portal-brand-wordmark {
   display: none;
}

/* Barra lateral: é escura nos dois temas, por isso estes elementos mantêm o
   fundo branco e o texto escuro. */
.portal-create {
   display: flex;
   align-items: center;
   gap: 12px;
   width: 100%;
   padding: 11px 14px;
   margin-bottom: 28px;
   border: 1px solid var(--portal-primary);
   border-radius: var(--radius-sm);
   background: #fff;
   color: #10243a;
   font-size: 13px;
   font-weight: 600;
   line-height: 1.25;
   text-align: left;
   box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
   transition: transform .15s ease, box-shadow .15s ease;
}

   .portal-create:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 18px var(--portal-shadow-primary-strong);
      color: #10243a;
   }

.portal-create-icon {
   display: grid;
   flex: 0 0 30px;
   width: 30px;
   height: 30px;
   place-items: center;
   border-radius: 50%;
   background: var(--portal-primary);
   color: #fff;
   font-size: 15px;
}

.portal-nav {
   display: flex;
   flex: 1 1 auto;
   flex-direction: column;
   gap: 6px;
   min-height: 0;
   overflow-y: auto;
   overflow-x: hidden;
   padding-right: 2px;
}

   .portal-nav::-webkit-scrollbar {
      width: 5px;
   }

   .portal-nav::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, .22);
      border-radius: 4px;
   }

.portal-nav-group {
   display: flex;
   flex-direction: column;
   gap: 4px;
}

.portal-nav-item,
.portal-nav-group-toggle {
   display: flex;
   align-items: center;
   gap: 14px;
   width: 100%;
   padding: 11px 14px;
   border: 0;
   border-radius: var(--radius-sm);
   background: transparent;
   color: #f3f3f3;
   font-size: 14px;
   font-weight: 500;
   text-align: left;
   cursor: pointer;
   transition: background .16s ease, color .16s ease, padding .16s ease;
}

   .portal-nav-item:hover,
   .portal-nav-group-toggle:hover {
      background: rgba(255, 255, 255, .09);
      color: #fff;
   }

   .portal-nav-item.active,
   .portal-nav-group-toggle.active {
      background: #fff;
      color: #10243a;
      font-weight: 600;
      box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
   }

.portal-nav-icon {
   display: grid;
   flex: 0 0 22px;
   width: 22px;
   height: 22px;
   place-items: center;
   font-size: 15px;
   color: #e9e9e9;
}

.portal-nav-item.active .portal-nav-icon,
.portal-nav-group-toggle.active .portal-nav-icon,
.portal-nav-item:hover .portal-nav-icon {
   color: var(--portal-primary);
}

.portal-nav-label {
   flex: 1 1 auto;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.portal-nav-chevron {
   font-size: 10px;
   opacity: .7;
   transition: transform .2s ease;
}

.portal-nav-group.is-open .portal-nav-chevron {
   transform: rotate(90deg);
}

.portal-subnav {
   display: flex;
   flex-direction: column;
   gap: 2px;
   margin: 2px 0 6px 30px;
   padding-left: 12px;
   border-left: 1px solid rgba(255, 255, 255, .14);
}

   .portal-subnav .portal-nav-item {
      padding: 8px 12px;
      font-size: 13px;
      font-weight: 400;
      color: #cfcfcf;
   }

      .portal-subnav .portal-nav-item .portal-nav-icon {
         flex-basis: 18px;
         width: 18px;
         font-size: 12px;
         color: #b9b9b9;
      }

      .portal-subnav .portal-nav-item.active {
         /* O item ativo usa o mesmo fundo branco do menu principal; o texto
            tem de manter a cor escura fixa, mesmo no tema escuro. */
         color: #10243a;
         font-weight: 600;
      }

.portal-sidebar-footer {
   display: flex;
   flex-direction: column;
   gap: 10px;
   padding-top: 18px;
   margin-top: 16px;
   border-top: 1px solid rgba(255, 255, 255, .1);
}

.portal-sidebar-user {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 6px 8px;
   border-radius: var(--radius-md);
   background: rgba(255, 255, 255, .06);
}

.portal-sidebar-user-profile {
   display: flex;
   flex: 1 1 auto;
   min-width: 0;
   align-items: center;
   gap: 10px;
   border-radius: var(--radius-md);
   color: inherit;
   text-decoration: none;
}

   .portal-sidebar-user-profile:hover {
      color: inherit;
      text-decoration: none;
   }

   .portal-sidebar-user-profile:focus-visible {
      outline: 2px solid var(--portal-primary);
      outline-offset: 2px;
   }

.portal-sidebar-user-avatar {
   display: grid;
   flex: 0 0 34px;
   width: 34px;
   height: 34px;
   place-items: center;
   overflow: hidden;
   border-radius: 50%;
   background: var(--portal-primary);
   color: #fff;
   font-weight: 700;
   font-size: 13px;
}

   .portal-sidebar-user-avatar img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: 50%;
   }

.portal-sidebar-user-info {
   min-width: 0;
}

.portal-sidebar-user-name {
   display: block;
   font-size: 12.5px;
   font-weight: 600;
   color: #fff;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.portal-sidebar-user-company {
   display: block;
   font-size: 10.5px;
   color: #93a8bd;
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
}

.portal-user-logout {
   display: grid;
   flex: 0 0 30px;
   width: 30px;
   height: 30px;
   margin-left: auto;
   padding: 0;
   place-items: center;
   border: 0;
   border-radius: var(--radius-sm);
   background: transparent;
   color: #9fb3c7;
   font-size: 13px;
   cursor: pointer;
   transition: background .15s ease, color .15s ease;
}

   .portal-user-logout:hover {
      background: rgba(255, 255, 255, .12);
      color: #fff;
   }

   .portal-user-logout:focus-visible {
      outline: 2px solid var(--portal-primary);
      outline-offset: 2px;
   }

.portal-sidebar.is-collapsed .portal-nav-label,
.portal-sidebar.is-collapsed .portal-create span,
.portal-sidebar.is-collapsed .portal-nav-chevron,
.portal-sidebar.is-collapsed .portal-sidebar-user-info {
   display: none;
}

.portal-sidebar.is-collapsed .portal-nav-item,
.portal-sidebar.is-collapsed .portal-nav-group-toggle {
   justify-content: center;
   padding-left: 0;
   padding-right: 0;
}

.portal-sidebar.is-collapsed .portal-sidebar-user {
   justify-content: center;
   gap: 4px;
   padding: 6px 2px;
}

.portal-sidebar.is-collapsed .portal-sidebar-user-profile {
   flex: 0 0 auto;
}

.portal-sidebar.is-collapsed .portal-sidebar-user-avatar {
   flex-basis: 28px;
   width: 28px;
   height: 28px;
   font-size: 11px;
}

.portal-sidebar.is-collapsed .portal-user-logout {
   flex: 0 0 28px;
   width: 28px;
   height: 28px;
   font-size: 11px;
}

.portal-sidebar.is-collapsed .portal-subnav {
   display: none;
}

.portal-sidebar.is-collapsed .portal-create {
   justify-content: center;
   padding: 9px;
}

/* --------------------------------------------------------------- topbar --- */

.portal-topbar {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 18px;
   min-height: 58px;
   margin-bottom: 6px;
}

.portal-topbar-left {
   display: flex;
   align-items: center;
   gap: 12px;
   min-width: 0;
}

.portal-breadcrumb {
   font-size: 13px;
   font-weight: 500;
   color: var(--portal-muted);
}

   .portal-breadcrumb strong {
      color: var(--portal-ink);
      font-weight: 700;
   }

.portal-topbar-actions {
   display: flex;
   align-items: center;
   gap: 12px;
}

.portal-search {
   position: relative;
   display: flex;
   align-items: center;
   width: clamp(180px, 22vw, 300px);
}

   .portal-search > i {
      position: absolute;
      top: 50%;
      left: 16px;
      transform: translateY(-50%);
      font-size: 13px;
      line-height: 1;
      color: var(--portal-muted);
      pointer-events: none;
   }

   .portal-search input {
      width: 100%;
      height: 44px;
      padding: 0 16px 0 40px;
      border: 1px solid #fff;
      border-radius: var(--radius-md);
      background: rgba(255, 255, 255, .82);
      color: var(--portal-ink);
      font-size: 13px;
      outline: none;
      box-shadow: var(--shadow-card);
      transition: box-shadow .16s ease, background .16s ease;
   }

      .portal-search input::placeholder {
         color: #93a8bd;
      }

      .portal-search input:focus {
         background: var(--portal-surface);
         box-shadow: 0 0 0 3px var(--portal-focus-ring);
      }

.portal-menu-toggle {
   display: none;
   width: 44px;
   height: 44px;
   place-items: center;
   border: 0;
   border-radius: 50%;
   background: var(--portal-black);
   color: #fff;
}

/* -------------------------------------------------------------- content --- */

.portal-content {
   flex: 1 1 auto;
   padding-bottom: 30px;
}

/* Page header ------------------------------------------------------------- */

.subheader {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 16px;
   margin: 4px 0 22px;
   padding: 0;
   border-bottom: 0 !important;
}

   .subheader .subheader-title {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 0;
      color: var(--portal-ink) !important;
      font-size: clamp(22px, 2.3vw, 32px) !important;
      font-weight: 800 !important;
      line-height: 1.15;
   }

      .subheader .subheader-title > i {
         display: grid !important;
         flex: 0 0 46px;
         width: 46px;
         height: 46px;
         place-items: center;
      border-radius: var(--radius-md);
         background: var(--portal-primary-soft);
         color: var(--portal-primary) !important;
         font-size: 19px !important;
         line-height: 1 !important;
      }

      .subheader .subheader-title .subheader-text {
         display: flex;
         flex-direction: column;
         gap: 2px;
      }

      .subheader .subheader-title .subheader-subtitle {
         color: var(--portal-muted) !important;
         font-size: 13px !important;
         font-weight: 500 !important;
      }

/* ---------------------------------------------------------------- cards --- */

.portal-card,
.dashboard-box {
   position: relative;
   margin: 0 0 18px;
   padding: 20px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-lg);
   background: var(--portal-card);
   box-shadow: var(--shadow-card);
   text-align: left;
   overflow: hidden;
}

.card {
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-lg);
   background: var(--portal-card);
   box-shadow: var(--shadow-card);
}

.card-body {
   padding: 20px;
}

.card-header {
   padding: 16px 20px;
   border-bottom: 1px solid var(--portal-line);
   background: transparent;
   font-weight: 700;
}

.dashboard-box-header {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 0 !important;
   margin-bottom: 14px;
   background: transparent !important;
   color: var(--portal-ink) !important;
}

   .dashboard-box-header i {
      position: static !important;
      display: grid;
      width: 38px;
      height: 38px;
      margin: 0 !important;
      place-items: center;
      border: 0 !important;
      border-radius: var(--radius-md);
      background: var(--portal-primary-soft) !important;
      color: var(--portal-primary) !important;
      font-size: 16px !important;
      line-height: 1 !important;
   }

   .dashboard-box-header h1 {
      height: auto !important;
      margin: 0 !important;
      padding: 0 !important;
      font-size: 15px !important;
      font-weight: 700 !important;
      line-height: 1.3 !important;
      color: var(--portal-ink) !important;
   }

.dashboard-box-title {
   margin-bottom: 6px;
   font-size: 16px;
   font-weight: 700;
}

.dashboard-box-icon {
   display: grid;
   width: 44px;
   height: 44px;
   margin: 6px auto 14px;
   place-items: center;
      border-radius: var(--radius-md);
   background: var(--portal-primary-soft);
   color: var(--portal-primary);
   font-size: 18px;
}

.dashboard-box-content {
   max-height: 360px;
   padding: 0 !important;
   overflow-y: auto;
}

.dashboard-box-list {
   display: flex;
   flex-direction: column;
   gap: 8px;
}

.dashboard-box-item {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 10px;
   padding: 8px 0;
   border-bottom: 1px dashed var(--portal-line);
   font-size: 13.5px;
   color: var(--portal-muted);
}

   .dashboard-box-item:last-child {
      border-bottom: 0;
   }

   .dashboard-box-item span {
      float: none !important;
      color: var(--portal-ink);
      font-weight: 700;
      font-size: 14px;
   }

.dashboard-box-empty {
   display: block;
   padding: 18px 0;
   color: var(--portal-muted);
   font-size: 13px;
   text-align: center;
}

.dashboard-box-button {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   margin: 10px 0 0 !important;
   padding: 10px 20px !important;
   border: 0 !important;
   border-radius: var(--radius-sm) !important;
   background: var(--portal-primary) !important;
   color: #fff !important;
   font-size: 13px;
   font-weight: 600;
   box-shadow: 0 8px 18px var(--portal-shadow-primary);
   transition: background .16s ease, transform .16s ease;
}

   .dashboard-box-button:hover:not(:disabled) {
      background: var(--portal-primary-dark) !important;
      color: #fff !important;
      transform: translateY(-1px);
   }

   .dashboard-box-button:disabled {
      background: var(--portal-disabled-surface) !important;
      color: #93a8bd !important;
      box-shadow: none;
   }

   .dashboard-box-button.btn-secondary {
      background: var(--portal-surface) !important;
      color: var(--portal-ink) !important;
      border: 1px solid var(--portal-line) !important;
      box-shadow: none;
   }

   .dashboard-box-button.btn-danger {
      background: var(--portal-danger) !important;
      color: #fff !important;
   }

/* Definições: alterar palavra-passe ---------------------------------------- */

.form-alterar-password {
   max-width: 380px;
   margin: 0 auto;
}

   .form-alterar-password .dashboard-box-title {
      text-align: center;
   }

   .form-alterar-password .form-label {
      margin-bottom: 4px;
      color: var(--portal-muted);
      font-size: 12px;
      font-weight: 600;
   }

.form-alterar-password-acoes {
   display: flex;
   margin-top: 4px;
}

   .form-alterar-password-acoes .dashboard-box-button {
      margin-top: 8px !important;
   }

/* Definições: escolha do tema (claro/escuro) -------------------------------- */

.tema-descricao {
   margin: 0 0 4px;
   color: var(--portal-muted);
   font-size: 13px;
}

.aparencia-grupo {
   display: flex;
   flex-direction: column;
   gap: 6px;
   margin-top: 14px;
}

.aparencia-etiqueta {
   color: var(--portal-muted);
   font-size: 12px;
   font-weight: 600;
}

/* Seletor de cor (pastilhas) */

.tema-cores {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
}

.tema-cor {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 7px 14px 7px 9px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-pill);
   background: var(--portal-surface);
   color: var(--portal-ink);
   font-size: 12.5px;
   font-weight: 600;
   transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

   .tema-cor:hover {
      border-color: var(--portal-primary);
   }

   .tema-cor.is-ativo {
      border-color: var(--portal-primary);
      background: var(--portal-primary-ghost);
      box-shadow: 0 0 0 2px var(--portal-focus-ring);
   }

   .tema-cor:focus-visible {
      outline: 2px solid var(--portal-primary);
      outline-offset: 2px;
   }

.tema-cor-amostra {
   display: block;
   width: 18px;
   height: 18px;
   border-radius: 50%;
   box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}

.tema-opcoes {
   display: inline-flex;
   /* O contentor é filho de uma coluna flex: sem isto estica à largura do
      cartão e a borda fica maior do que as duas opções. */
   align-self: flex-start;
   gap: 6px;
   margin-top: 10px;
   padding: 5px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-pill);
   background: var(--portal-card-alt);
}

.tema-opcao {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 9px 20px;
   border: 0;
   border-radius: var(--radius-pill);
   background: transparent;
   color: var(--portal-muted);
   font-size: 13px;
   font-weight: 600;
   transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

   .tema-opcao:hover {
      background: var(--portal-tint-primary);
      color: var(--portal-ink);
   }

   .tema-opcao.is-ativo {
      background: var(--portal-primary);
      color: #fff;
      box-shadow: 0 6px 14px var(--portal-shadow-primary);
   }

   .tema-opcao:focus-visible {
      outline: 2px solid var(--portal-primary);
      outline-offset: 2px;
   }

/* ------------------------------------------------------------------ KPI --- */

.portal-kpi-grid {
   display: grid;
   grid-template-columns: repeat(12, minmax(0, 1fr));
   gap: 18px;
   margin-bottom: 18px;
}

.portal-kpi {
   position: relative;
   display: flex;
   flex-direction: column;
   gap: 14px;
   grid-column: span 4;
   min-height: 156px;
   padding: 20px;
   border-radius: var(--radius-lg);
   background: var(--portal-card);
   border: 1px solid transparent;
   box-shadow: var(--shadow-card);
   overflow: hidden;
}

   .portal-kpi.kpi-green {
      background: var(--portal-green-soft);
      border-color: #c9ecd4;
   }

   .portal-kpi.kpi-peach {
      background: #d9ecff;
      border-color: #b9dcfb;
   }

   .portal-kpi.kpi-blue {
      background: var(--portal-blue-soft);
      border-color: #a5d2fa;
   }

   .portal-kpi.kpi-sand {
      background: var(--color-5);
      border-color: #c3e3fd;
   }

.portal-kpi-icon {
   display: grid;
   width: 40px;
   height: 40px;
   place-items: center;
      border-radius: var(--radius-md);
   background: rgba(255, 255, 255, .72);
   font-size: 16px;
}

.kpi-green .portal-kpi-icon {
   color: var(--portal-green);
}

.kpi-peach .portal-kpi-icon {
   color: var(--portal-primary);
}

.kpi-blue .portal-kpi-icon {
   color: var(--portal-primary);
}

.kpi-sand .portal-kpi-icon {
   color: var(--portal-primary-dark);
}

.portal-kpi-label {
   font-size: 12.5px;
   font-weight: 600;
   color: #46627c;
}

.portal-kpi-value {
   display: flex;
   align-items: baseline;
   gap: 6px;
   margin-top: auto;
   font-size: clamp(26px, 2.6vw, 38px);
   font-weight: 800;
   line-height: 1;
   letter-spacing: -.03em;
   color: var(--portal-ink);
}

   .portal-kpi-value small {
      font-size: 13px;
      font-weight: 600;
      color: #6b8299;
      letter-spacing: 0;
   }

.portal-kpi-foot {
   display: flex;
   align-items: center;
   gap: 6px;
   font-size: 11.5px;
   color: #56697d;
}

   .portal-kpi-foot .up {
      color: var(--portal-green);
      font-weight: 700;
   }

   .portal-kpi-foot .down {
      color: var(--portal-danger);
      font-weight: 700;
   }

.portal-kpi .portal-kpi-action {
   position: absolute;
   top: 18px;
   right: 18px;
}

.portal-mini-button {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   padding: 7px 13px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-sm);
   background: var(--portal-surface);
   color: var(--portal-ink);
   font-size: 11.5px;
   font-weight: 600;
   white-space: nowrap;
}

   .portal-mini-button:hover {
      background: var(--portal-primary-ghost);
      color: var(--portal-primary-dark);
   }

/* ------------------------------------------------------- dashboard grid --- */

.portal-dashboard {
   display: grid;
   grid-template-columns: repeat(12, minmax(0, 1fr));
   gap: 18px;
}

.portal-span-3 {
   grid-column: span 3;
}

.portal-span-4 {
   grid-column: span 4;
}

.portal-span-5 {
   grid-column: span 5;
}

.portal-span-6 {
   grid-column: span 6;
}

.portal-span-7 {
   grid-column: span 7;
}

.portal-span-8 {
   grid-column: span 8;
}

.portal-span-9 {
   grid-column: span 9;
}

.portal-span-12 {
   grid-column: span 12;
}

/* Cards do portal — mesma linguagem do B2B: superfície plana, contorno
   hairline, canto de 12px e cabeçalho separado por uma linha. */
.portal-panel {
   display: flex;
   flex-direction: column;
   min-width: 0;
   overflow: hidden;
   padding: 0;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-md);
   background: var(--portal-card);
   box-shadow: none;
}

.portal-panel-head {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 14px;
   min-height: 46px;
   margin: 0;
   padding: 10px 16px;
   border-bottom: 1px solid var(--portal-line);
}

.portal-panel-title {
   margin: 0;
   font-size: 14px;
   font-weight: 600;
   color: var(--portal-ink);
}

.portal-panel-subtitle {
   display: block;
   margin-top: 2px;
   font-size: 11.5px;
   font-weight: 500;
   color: var(--portal-muted);
}

/* Conteúdo directo do cartão (sem .portal-panel-body) herda o espaçamento
   do corpo, para que todos os cartões tenham a mesma métrica. */
.portal-panel > .portal-panel-body {
   padding: 14px 16px 16px;
}

.portal-panel > :not(.portal-panel-head):not(.portal-panel-body) {
   margin: 14px 16px;
}

.portal-panel > :not(.portal-panel-head):not(.portal-panel-body):last-child {
   margin-bottom: 16px;
}

/* ------------------------------------------------ cartão (design B2B) --- */

.portal-card {
   display: flex;
   flex-direction: column;
   min-width: 0;
   overflow: hidden;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-md);
   background: var(--portal-card);
}

.portal-card-head {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 12px;
   min-height: 46px;
   padding: 9px 16px;
   border-bottom: 1px solid var(--portal-line);
}

.portal-card-heading {
   display: flex;
   align-items: center;
   gap: 9px;
   min-width: 0;
}

.portal-card-icon {
   display: grid;
   flex: 0 0 28px;
   width: 28px;
   height: 28px;
   place-items: center;
   border-radius: var(--radius-sm);
   background: var(--portal-primary-ghost);
   color: var(--portal-primary-dark);
   font-size: 12px;
}

.portal-card-title {
   overflow: hidden;
   margin: 0;
   color: var(--portal-ink);
   font-size: 14px;
   font-weight: 600;
   line-height: 1.25;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.portal-card-actions {
   display: flex;
   flex: 0 0 auto;
   align-items: center;
   gap: 8px;
}

.portal-card-body {
   padding: 14px 16px 16px;
}

/* Cartão isolado (fora da grelha do dashboard) precisa do seu intervalo. */
.portal-card-block {
   margin-bottom: 16px;
}

.portal-select-pill {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 7px 14px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-pill);
   background: var(--portal-surface);
   color: var(--portal-ink);
   font-size: 11.5px;
   font-weight: 600;
}

/* Segmented progress ------------------------------------------------------ */

.portal-segment-bar {
   display: flex;
   width: 100%;
   height: 14px;
   border-radius: var(--radius-pill);
   background: #e6f1fb;
   overflow: hidden;
}

.portal-segment {
   height: 100%;
   transition: width .4s ease;
}

   .portal-segment.seg-green {
      background: var(--portal-green);
   }

   .portal-segment.seg-teal {
      background: var(--portal-teal);
   }

   .portal-segment.seg-orange {
      background: var(--portal-primary);
   }

   .portal-segment.seg-red {
      background: var(--portal-danger);
   }

.portal-segment-legend {
   display: flex;
   flex-wrap: wrap;
   gap: 10px 22px;
   margin-top: 16px;
}

.portal-legend-item {
   display: flex;
   align-items: center;
   gap: 8px;
   font-size: 12px;
   color: var(--portal-muted);
}

   .portal-legend-item b {
      color: var(--portal-ink);
      font-size: 13px;
   }

.portal-legend-dot {
   width: 9px;
   height: 9px;
   border-radius: 50%;
   background: var(--portal-primary);
}

/* Circular gauge ---------------------------------------------------------- */

.portal-gauge {
   position: relative;
   width: 150px;
   height: 150px;
   margin: 4px auto 0;
   border-radius: 50%;
   background: conic-gradient(var(--portal-primary) calc(var(--gauge, 0) * 1%), #e1eefa 0);
   display: grid;
   place-items: center;
}

   .portal-gauge::after {
      content: "";
      position: absolute;
      inset: 16px;
      border-radius: 50%;
      background: var(--portal-card);
      box-shadow: inset 0 0 0 1px var(--portal-line);
   }

.portal-gauge-content {
   position: relative;
   z-index: 1;
   text-align: center;
}

.portal-gauge-value {
   display: block;
   font-size: 30px;
   font-weight: 800;
   letter-spacing: -.03em;
   line-height: 1;
}

.portal-gauge-label {
   display: block;
   margin-top: 5px;
   font-size: 11px;
   font-weight: 500;
   color: var(--portal-muted);
}

.portal-stat-row {
   display: flex;
   justify-content: space-around;
   gap: 8px;
   margin-top: 22px;
   padding-top: 16px;
   border-top: 1px solid var(--portal-line);
}

.portal-stat {
   text-align: center;
}

.portal-stat-value {
   display: block;
   font-size: 18px;
   font-weight: 800;
   line-height: 1.1;
}

.portal-stat-label {
   display: block;
   margin-top: 4px;
   font-size: 10.5px;
   color: var(--portal-muted);
}

/* ------------------------------------------------------------- timeline --- */

.portal-timeline {
   position: relative;
   display: flex;
   flex-direction: column;
   gap: 14px;
   padding-left: 4px;
}

.portal-timeline-item {
   display: flex;
   gap: 12px;
   align-items: flex-start;
}

.portal-timeline-dot {
   display: grid;
   flex: 0 0 34px;
   width: 34px;
   height: 34px;
   place-items: center;
   border-radius: 50%;
   background: var(--portal-primary-soft);
   color: var(--portal-primary);
   font-size: 12px;
}

.portal-timeline-time {
   font-size: 13px;
   font-weight: 700;
   color: var(--portal-ink);
}

.portal-timeline-text {
   font-size: 11.5px;
   color: var(--portal-muted);
}

/* --------------------------------------------------------------- people --- */

.portal-people {
   display: flex;
   flex-direction: column;
   gap: 6px;
   max-height: 300px;
   overflow-y: auto;
}

.portal-person {
   display: flex;
   align-items: center;
   gap: 12px;
   padding: 8px;
   border-radius: var(--radius-md);
   transition: background .15s ease;
}

   .portal-person:hover {
      background: var(--portal-card-alt);
   }

.portal-person-avatar {
   width: 40px;
   height: 40px;
   border-radius: 50%;
   object-fit: cover;
   background: var(--portal-primary-soft);
   border: 2px solid #fff;
   box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}

.portal-person-name {
   font-size: 13px;
   font-weight: 600;
   color: var(--portal-ink);
}

.portal-person-meta {
   font-size: 11px;
   color: var(--portal-muted);
}

/* ------------------------------------------------------------------ news --- */

.portal-news {
   display: flex;
   flex-direction: column;
   gap: 14px;
   max-height: 380px;
   overflow-y: auto;
   padding-right: 4px;
}

.portal-news-item {
   padding: 14px 16px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-md);
   background: var(--portal-card-alt);
}

   .portal-news-item h3 {
      margin: 0 0 4px;
      font-size: 14px;
      font-weight: 700;
   }

   .portal-news-item small {
      display: block;
      margin-bottom: 8px;
      font-size: 11px;
      color: var(--portal-muted);
   }

   .portal-news-item .ql-editor {
      max-height: 130px;
      overflow: hidden;
      padding: 0 !important;
      font-size: 12.5px;
      line-height: 1.55;
      color: var(--portal-news-ink);
   }

   .portal-news-item .solid-divider {
      display: none;
   }

.noticias-list {
   display: flex;
   flex-direction: column;
   gap: 10px;
}

.noticia-item {
   padding: 14px 16px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-md);
   background: var(--portal-card-alt);
}

.noticia-titulo {
   font-size: 14px;
   font-weight: 700;
}

.noticia-data {
   font-size: 11px;
   color: var(--portal-muted);
}

.noticia-editar {
   margin-top: 6px;
   font-size: 12px;
   color: var(--portal-primary);
}

/* --------------------------------------------------------------- tables --- */

.table,
table.table {
   margin-bottom: 0;
   color: var(--portal-ink);
   font-size: 13px;
   border-collapse: separate;
   border-spacing: 0;
}

   .table > thead > tr > th,
   .table > thead > tr > td {
      padding: 12px 14px;
      border: 0;
      background: var(--portal-surface-alt);
      color: var(--portal-head-ink);
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .06em;
      text-transform: uppercase;
      white-space: nowrap;
   }

      .table > thead > tr > th:first-child,
      .table > thead > tr > td:first-child {
          border-radius: var(--radius-md) 0 0 var(--radius-md);
      }

      .table > thead > tr > th:last-child,
      .table > thead > tr > td:last-child {
          border-radius: 0 var(--radius-md) var(--radius-md) 0;
      }

   .table > tbody > tr > td,
   .table > tbody > tr > th {
      padding: 13px 14px;
      border: 0;
      border-bottom: 1px solid var(--portal-line);
      vertical-align: middle;
   }

   .table > tbody > tr:last-child > td {
      border-bottom: 0;
   }

   .table-striped > tbody > tr:nth-of-type(odd) > * {
      background: transparent;
      box-shadow: none;
   }

   .table-hover > tbody > tr:hover > * {
      background: var(--portal-card-alt);
   }

.table-responsive,
.portal-table-card {
   padding: 14px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-lg);
   background: var(--portal-card);
   box-shadow: var(--shadow-card);
}

caption,
.bscaption {
   padding: 4px 2px 10px;
   color: var(--portal-muted);
   font-size: 12px;
   font-weight: 600;
}

/* Tabela padrão do portal (componente PortalTable) ------------------------- */

.portal-table-toolbar {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 10px;
   margin-bottom: 12px;
}

.portal-table-scroll {
   overflow-x: auto;
}

   .portal-table-scroll > .table {
      width: 100%;
   }

.portal-table-empty {
   padding: 26px 12px;
   color: var(--portal-muted);
   font-size: 13px;
   text-align: center;
}

.portal-table-group > td {
   background: var(--portal-card-alt) !important;
   color: var(--portal-primary-dark);
   font-size: 12px;
   font-weight: 700;
   letter-spacing: .04em;
   text-transform: uppercase;
}

/* Mapa de férias: dias com férias (completo/meio dia) */
.mapa-ferias-dia {
   text-align: center;
   padding: 6px 4px !important;
}

   .mapa-ferias-dia.is-completo {
      background: var(--portal-green) !important;
      color: #fff;
   }

   .mapa-ferias-dia.is-meio {
      background: #accbfc !important;
      color: var(--portal-ink);
   }

.portal-table-pager {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   justify-content: space-between;
   gap: 12px;
   padding-top: 12px;
   color: var(--portal-muted);
   font-size: 12px;
}

.portal-table-pager-actions {
   display: inline-flex;
   align-items: center;
   gap: 8px;
}

.portal-table-pager-btn {
   display: inline-grid;
   place-items: center;
   width: 30px;
   height: 30px;
   border: 1px solid var(--portal-line);
   border-radius: 50%;
   background: var(--portal-surface);
   color: var(--portal-primary-dark);
   font-size: 12px;
}

   .portal-table-pager-btn:hover:not(:disabled) {
      background: var(--portal-primary-ghost);
   }

   .portal-table-pager-btn:disabled {
      opacity: .45;
      cursor: default;
   }

/* Ações de linha nas tabelas (estado + consultar) -------------------------- */

.portal-table-acoes {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 10px;
   line-height: 1;
}

   /* O ícone de estado e o botão de consulta ocupam a mesma caixa, para que os
      glifos fiquem alinhados ao centro (sem desvios de baseline). */
   .portal-table-acoes > i,
   .portal-table-acao {
      display: inline-grid;
      place-items: center;
      width: 28px;
      height: 28px;
      font-size: 16px;
      line-height: 1;
   }

.portal-table-acao {
   border-radius: var(--radius-sm);
   color: #484848;
   text-decoration: none;
   transition: background .15s ease, color .15s ease;
}

   .portal-table-acao:hover {
      background: var(--portal-primary-soft);
      color: var(--portal-primary);
   }

.button-pdf,
.button-edit {
   display: inline-grid;
   width: 32px;
   height: 32px;
   place-items: center;
   border: 0;
   border-radius: var(--radius-sm);
   background: var(--portal-primary-soft);
   color: var(--portal-primary);
   cursor: pointer;
   transition: background .15s ease, color .15s ease;
}

   .button-pdf:hover,
   .button-edit:hover {
      background: var(--portal-primary);
      color: #fff;
   }

.btnIconDelete,
.btnIconEdit {
   color: inherit;
}

/* -------------------------------------------------------------- buttons --- */

.btn {
   border-radius: var(--radius-sm);
   font-family: inherit;
   font-size: 13px;
   font-weight: 600;
   transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-primary,
.btn.btn-primary {
   border: 0;
   background: var(--portal-primary);
   color: #fff;
   box-shadow: 0 8px 18px var(--portal-shadow-primary);
}

   .btn-primary:hover,
   .btn-primary:focus,
   .btn.btn-primary:hover {
      background: var(--portal-primary-dark);
      color: #fff;
   }

.btn-outline-primary {
   border-color: var(--portal-primary);
   color: var(--portal-primary);
}

   .btn-outline-primary:hover {
      background: var(--portal-primary);
      border-color: var(--portal-primary);
      color: #fff;
   }

.btn-secondary {
   border-color: var(--portal-line);
   background: var(--portal-surface);
   color: var(--portal-ink);
}

   .btn-secondary:hover {
      background: var(--portal-surface-alt);
      border-color: var(--portal-line);
      color: var(--portal-ink);
   }

/* Ação principal de um serviço (entrada/saída): alvo grande, para uso
   em campo, com telemóvel na mão. */
.portal-action-primary {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   gap: 9px;
   width: 100%;
   min-height: 48px;
   padding: 10px 18px;
   font-size: 15px;
   font-weight: 700;
}

   .portal-action-primary:disabled {
      opacity: .65;
   }

.button-isolado {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   margin: 0 0 16px;
   padding: 10px 20px;
   border: 0;
   border-radius: var(--radius-sm);
   background: var(--portal-primary);
   color: #fff;
   font-size: 13px;
   font-weight: 600;
   box-shadow: 0 8px 18px var(--portal-shadow-primary);
}

   .button-isolado:hover {
      background: var(--portal-primary-dark);
      color: #fff;
   }

   .button-isolado.button-isolado-listas {
      height: auto;
      margin-left: 0;
   }

/* ---------------------------------------------------------------- forms --- */

/* Barra de filtros das páginas (Data, botão Atualizar, ...). Alinha os
   controlos numa única linha, com os fundos/baselines iguais. */
.filtros-barra {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 12px;
}

   .filtros-barra .col-form-label {
      margin-bottom: 0;
   }

   /* Os botões do portal têm margem superior própria; dentro da barra de
      filtros a margem é controlada pelo "gap" para ficarem alinhados. */
   .filtros-barra .dashboard-box-button {
      margin: 0 !important;
   }

/* Botão do calendário dos editores de data (DevExpress Blazor): o tema
   desenha um fundo no botão (--dxbl-text-edit-btn-bg); aqui fica transparente,
   mantendo o ícone. */
.dxbl-text-edit .dxbl-edit-btn-dropdown,
.dxbl-text-edit .dxbl-edit-btn-dropdown:hover,
.dxbl-text-edit .dxbl-edit-btn-dropdown:focus-visible,
.dxbl-text-edit .dxbl-edit-btn-dropdown.dxbl-focused {
   --dxbl-btn-bg: transparent;
   --dxbl-btn-hover-bg: transparent;
   --dxbl-btn-active-bg: transparent;
   --dxbl-btn-disabled-bg: transparent;
   background-color: transparent !important;
   border-color: transparent !important;
   box-shadow: none !important;
}

.form-control,
.form-select,
textarea.form-control,
input.form-control {
   min-height: 44px;
   padding: 10px 16px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-sm);
   background: var(--portal-surface);
   color: var(--portal-ink);
   font-family: inherit;
   font-size: 13px;
   box-shadow: none;
   transition: border-color .15s ease, box-shadow .15s ease;
}

.form-select {
   border-radius: var(--radius-md);
}

textarea.form-control,
.textAreaModal {
   min-height: 100px;
   padding: 14px 16px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-md);
   background: var(--portal-surface);
   color: var(--portal-ink);
   font-family: inherit;
   font-size: 13px;
   outline: none;
   width: 100%;
   resize: vertical;
}

.form-control:focus,
.form-select:focus,
.textAreaModal:focus {
   border-color: var(--portal-primary);
   box-shadow: 0 0 0 3px var(--portal-focus-ring);
   background: var(--portal-surface);
}

.form-label,
label {
   margin-bottom: 6px;
   color: var(--portal-head-ink);
   font-size: 11.5px;
   font-weight: 700;
   letter-spacing: .03em;
}

.form-check-input:checked {
   background-color: var(--portal-primary);
   border-color: var(--portal-primary);
}

.validation-message,
.text-danger {
   color: var(--portal-danger) !important;
   font-size: 11.5px;
}

.valid.modified:not([type=checkbox]) {
   outline: 1px solid var(--portal-green);
}

.invalid {
   outline: 1px solid var(--portal-danger);
}

input[type=file]::file-selector-button {
   border: 0;
   border-radius: var(--radius-sm);
   background: var(--portal-primary);
   color: #fff;
   padding: 8px 16px;
   margin-right: 14px;
}

/* ------------------------------------------------------------ devExpress --- */

.dxbl,
.dxbl-grid,
.dxbl-card,
.dxbl-edit,
.dxbl-text-edit,
.dxbl-combobox,
.dxbl-date-edit,
.dxbl-time-edit,
.dxbl-spin-edit {
   font-family: inherit !important;
}

.dxbl-grid {
   border: 1px solid var(--portal-line) !important;
   border-radius: var(--radius-lg) !important;
   overflow: hidden;
   background: var(--portal-card);
}

.dxbl-grid-header,
.dxbl-grid .dxbl-grid-header {
   background: var(--portal-surface-alt) !important;
   color: var(--portal-head-ink) !important;
   font-size: 11px !important;
   font-weight: 700 !important;
   letter-spacing: .06em;
   text-transform: uppercase;
}

.dxbl-grid td,
.dxbl-grid th {
   border-color: var(--portal-line) !important;
   font-size: 13px;
}

.dxbl-grid-row:hover td {
   background: var(--portal-card-alt) !important;
}

.dxbl-grid-pager {
   background: transparent !important;
   border-top: 1px solid var(--portal-line);
}

.dxbl-edit,
.dxbl-combobox,
.dxbl-spin-edit {
   border-radius: var(--radius-md) !important;
}

/* Editores de data/texto: a curva do controlo é menor e os botões internos
   (calendário/limpar) ficam recuados, para não ficarem sobrepostos à borda. */
.dxbl-text-edit {
   border-radius: var(--radius-md) !important;
}

   .dxbl-text-edit .dxbl-btn-group {
      background: transparent !important;
      padding-right: 5px;
   }

   .dxbl-text-edit .dxbl-edit-btn-dropdown,
   .dxbl-text-edit .dxbl-edit-btn-clear {
      border-radius: var(--radius-sm) !important;
   }

.dxbl-edit.dxbl-focused,
.dxbl-text-edit.dxbl-focused,
.dxbl-combobox.dxbl-focused {
   box-shadow: 0 0 0 3px var(--portal-focus-ring) !important;
}

.dxbl-btn {
   border-radius: var(--radius-sm) !important;
}

.dxbl-btn-primary {
   background: var(--portal-primary) !important;
   border-color: var(--portal-primary) !important;
}

/* Blazorise / BlazorStrap tables inside cards ------------------------------ */

.b-table,
.rc-table {
   width: 100%;
}

/* --------------------------------------------------------------- modals --- */

.modal-content {
   border: 0;
   border-radius: var(--radius-lg);
   background: var(--portal-card);
   box-shadow: 0 30px 70px rgba(13, 71, 161, .22);
   overflow: hidden;
}

.modal-header {
   padding: 20px 24px 14px;
   border-bottom: 1px solid var(--portal-line);
   background: var(--portal-card);
}

.modal-title {
   font-size: 16px;
   font-weight: 700;
}

.modal-body {
   padding: 20px 24px;
}

.modal-footer {
   padding: 14px 24px 20px;
   border-top: 0;
   gap: 8px;
}

.modal-backdrop.show {
   opacity: .42;
}

.ModalAusencias-header {
   border-bottom: 1px solid var(--portal-line);
}

.ModalAusencias-footer {
   border-top: 0;
}

.RadioBtnList {
   display: flex;
   flex-wrap: wrap;
   gap: 10px;
   padding: 0;
   margin: 14px 0;
   list-style: none;
}

.liRadio {
   padding: 8px 14px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-sm);
   background: var(--portal-surface);
   font-size: 12.5px;
}

.spanContainer {
   padding: 8px 0;
   border-bottom: 1px dashed var(--portal-line);
}

/* ---------------------------------------------------------------- tabs ---- */

.nav-tabs {
   border-bottom: 1px solid var(--portal-line);
   gap: 6px;
}

   .nav-tabs .nav-link {
      border: 0;
   border-radius: var(--radius-sm);
      padding: 8px 16px;
      color: var(--portal-muted);
      font-size: 12.5px;
      font-weight: 600;
   }

      .nav-tabs .nav-link.active {
         background: var(--portal-primary-soft);
         color: var(--portal-primary-dark);
      }

/* -------------------------------------------------------------- alerts ---- */

.alert {
   border: 0;
   border-radius: var(--radius-md);
   font-size: 12.5px;
}

.alert-warning {
   background: #fdf0d5;
   color: #7a5a13;
}

.alert-success {
   background: #e2f3e6;
   color: #1f6b36;
}

.alert-danger {
   background: #fbe1e1;
   color: #8a2626;
}

.badge {
   border-radius: var(--radius-pill);
   font-weight: 600;
}

/* ------------------------------------------------------------ calendars --- */

.legenda-calendar-year,
.legenda-calendar-row {
   margin-bottom: 14px;
}

.year-calendar {
   font-size: 20px;
   font-weight: 800;
   color: var(--portal-ink);
}

.ItemInfoFerias {
   font-size: 10.5px;
   color: var(--portal-muted);
}

.TableInfoFerias {
   padding: 14px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-lg);
   background: var(--portal-card);
}

.colInfoFerias {
   text-align: center;
}

.box-legenda-calendar {
   display: inline-block;
   width: 12px;
   height: 12px;
   margin-right: 6px;
   border-radius: 3px;
   vertical-align: middle;
}

.legenda-calendar {
   display: flex;
   align-items: center;
   font-size: 11.5px;
   color: var(--portal-muted);
}

/* calendar widget (js-year-calendar) */
.calendar {
   border: 0 !important;
}

   .calendar .calendar-header {
      border: 0;
   }

   .calendar table {
      border-collapse: separate;
      border-spacing: 3px;
   }

   .calendar table td {
   border-radius: var(--radius-sm);
   }

   .calendar .day {
      border-radius: var(--radius-md) !important;
      font-size: 12px;
   }

   .calendar .month-container {
      box-sizing: border-box;
      margin-bottom: 10px;
      border: 1px solid var(--portal-line);
      border-radius: var(--radius-lg);
      background: var(--portal-card);
      padding: 8px;
   }

.calendar .calendar-header h2 {
   font-size: 16px;
   font-weight: 700;
}

.calendar .day.today {
   background: var(--portal-primary) !important;
   color: #fff !important;
      border-radius: var(--radius-md);
}

/* ----------------------------------------------------------- workflow ----- */

.workflow-numero-pendentes {
   display: inline-grid;
   min-width: 22px;
   height: 22px;
   padding: 0 6px;
   place-items: center;
   border-radius: var(--radius-pill);
   background: var(--portal-primary);
   color: #fff;
   font-size: 11px;
   font-weight: 700;
}

.workflow-decisao {
   padding-left: 0;
   list-style: none;
}

   .workflow-decisao > li {
      padding: 14px;
      margin: 6px 0 12px;
      border: 1px solid var(--portal-line);
      border-radius: var(--radius-md);
      background: var(--portal-card);
   }

.justificacao-input {
   width: 100%;
   margin: 8px 0;
   padding: 9px 14px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-sm);
   font-size: 12.5px;
}

.workflow-decisoes {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
}

   .workflow-decisoes button {
      padding: 7px 16px;
      border: 1px solid var(--portal-primary);
   border-radius: var(--radius-sm);
      background: var(--portal-surface);
      font-size: 12px;
      font-weight: 600;
   }

/* ---------------------------------------------------------- login page ---- */

.portal-auth {
   position: relative;
   z-index: 1;
   display: grid;
   grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
   width: 100%;
   max-width: 1060px;
   min-height: 620px;
   margin: auto;
   border-radius: var(--radius-xl);
   overflow: hidden;
   background: var(--portal-card);
   box-shadow: 0 30px 80px rgba(13, 71, 161, .22);
}

body:has(.portal-auth) {
   display: flex;
   align-items: center;
   justify-content: center;
}

.portal-auth-brand {
   position: relative;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
   padding: 46px;
   color: #fff;
   background:
      radial-gradient(circle at 78% 18%, var(--portal-glow-primary) 0, transparent 42%),
      var(--portal-hero-gradient);
   overflow: hidden;
}

   .portal-auth-brand::after {
      content: "";
      position: absolute;
      right: -150px;
      bottom: -170px;
      width: 320px;
      height: 320px;
      border-radius: 50%;
      border: 52px solid var(--portal-ring-primary);
   }

.portal-auth-logo {
   position: relative;
   z-index: 1;
   display: inline-flex;
   align-items: center;
   gap: 12px;
   color: #fff;
   font-size: 30px;
   font-weight: 800;
   letter-spacing: -.045em;
   line-height: 1;
}

.portal-auth-logo-img {
   display: block;
   width: auto;
   height: 42px;
   max-width: 240px;
   object-fit: contain;
}

.portal-auth-title {
   position: relative;
   z-index: 1;
   margin: 0 0 12px;
   max-width: 420px;
   color: #fff;
   font-size: clamp(28px, 3.4vw, 42px);
   font-weight: 800;
   line-height: 1.08;
   letter-spacing: -.03em;
}

.portal-auth-subtitle {
   position: relative;
   z-index: 1;
   max-width: 360px;
   margin: 0;
   color: #d6e6f3;
   font-size: 13.5px;
   line-height: 1.6;
}

.portal-auth-points {
   position: relative;
   z-index: 1;
   display: flex;
   flex-direction: column;
   gap: 12px;
   padding: 0;
   margin: 26px 0 0;
   list-style: none;
   color: #d9e8f4;
   font-size: 12.5px;
}

   .portal-auth-points i {
      margin-right: 10px;
      color: var(--portal-primary);
   }

.portal-auth-form {
   display: flex;
   flex-direction: column;
   justify-content: center;
   padding: 44px clamp(26px, 4vw, 58px);
   background: var(--portal-shell);
}

   .portal-auth-form .form-signin {
      width: 100%;
      max-width: 340px;
      margin: 0 auto;
   }

   .portal-auth-form img {
      display: none;
   }

   .portal-auth-form h2 {
      margin: 0 0 6px;
      font-size: 24px;
      font-weight: 800;
   }

   .portal-auth-form .portal-auth-hint {
      margin-bottom: 24px;
      color: var(--portal-muted);
      font-size: 12.5px;
   }

   .portal-auth-form .form-control {
      height: 48px;
   }

   .portal-auth-form .btn-primary {
      height: 48px;
      margin-top: 6px;
      font-size: 14px;
   }

.portal-auth-footer {
   margin-top: 22px;
   color: rgba(255, 255, 255, .74);
   font-size: 11px;
   text-align: center;
}

/* -------------------------------------------------------------- helpers --- */

.portal-muted {
   color: var(--portal-muted) !important;
}

.portal-empty {
   padding: 26px 12px;
   color: var(--portal-muted);
   font-size: 13px;
   text-align: center;
}

/* ------------------------------------------------------------ skeletons --- */

.rc-skeleton {
   display: block;
   border-radius: var(--radius-sm);
   background: linear-gradient(90deg,
      var(--portal-card-alt) 25%,
      var(--portal-line) 37%,
      var(--portal-card-alt) 63%);
   background-size: 400% 100%;
   animation: rc-skeleton-wave 1.4s ease infinite;
}

.rc-skeleton-line {
   width: 58%;
   height: 12px;
}

.rc-skeleton-value {
   width: 40%;
   height: 30px;
   margin-top: 18px;
}

.rc-skeleton-card {
   width: 100%;
   height: 96px;
}

@keyframes rc-skeleton-wave {
   from {
      background-position: 100% 50%;
   }

   to {
      background-position: 0 50%;
   }
}

@media (prefers-reduced-motion: reduce) {
   .rc-skeleton {
      animation: none;
   }
}

.sem-dados {
   padding: 22px;
   border: 1px dashed var(--portal-line);
   border-radius: var(--radius-md);
   color: var(--portal-muted);
   text-align: center;
}

.cartao {
   padding: 16px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-lg);
   background: var(--portal-card);
   box-shadow: var(--shadow-card);
}

.periodos .cabecalho {
   color: var(--portal-ink);
   font-weight: 700;
}

.periodos ul {
   border-top: 1px solid var(--portal-line);
}

.periodos ul li {
   border-bottom: 1px solid var(--portal-line);
   color: #56718b;
}

/* ---------------------------------------------------------- scrollbars ---- */

.portal-content ::-webkit-scrollbar,
.portal-panel ::-webkit-scrollbar,
.dashboard-box-content::-webkit-scrollbar,
.portal-news::-webkit-scrollbar,
.portal-people::-webkit-scrollbar {
   width: 6px;
}

.portal-content ::-webkit-scrollbar-track,
.portal-panel ::-webkit-scrollbar-track,
.dashboard-box-content::-webkit-scrollbar-track,
.portal-news::-webkit-scrollbar-track,
.portal-people::-webkit-scrollbar-track {
   background: transparent;
}

.portal-content ::-webkit-scrollbar-thumb,
.portal-panel ::-webkit-scrollbar-thumb,
.dashboard-box-content::-webkit-scrollbar-thumb,
.portal-news::-webkit-scrollbar-thumb,
.portal-people::-webkit-scrollbar-thumb {
   background: #c3e3fd;
   border-radius: 6px;
}

/* ------------------------------------------------- sidebar toggle + hint --- */

.portal-sidebar-toggle {
   position: absolute;
   top: 16px;
   right: -14px;
   z-index: 5;
   display: grid;
   width: 30px;
   height: 30px;
   place-items: center;
   border: 1px solid var(--portal-line);
   border-radius: 50%;
   background: var(--portal-surface);
   color: var(--portal-ink);
   font-size: 10px;
   box-shadow: 0 6px 16px rgba(7, 25, 45, .25);
   opacity: 0;
   transition: opacity .16s ease, color .16s ease, transform .16s ease;
}

.portal-sidebar:hover .portal-sidebar-toggle,
.portal-sidebar-toggle:focus-visible {
   opacity: 1;
}

.portal-sidebar-toggle:hover {
   color: var(--portal-primary);
   transform: scale(1.06);
}

/* No telemóvel a gaveta do menu tem um botão de fechar próprio (o botão de
   recolher do desktop fica escondido). */
.portal-sidebar-fechar {
   display: none;
   position: absolute;
   top: 12px;
   right: 12px;
   z-index: 6;
   width: 44px;
   height: 44px;
   place-items: center;
   border: 0;
   border-radius: 50%;
   background: rgba(255, 255, 255, .12);
   color: #fff;
   font-size: 18px;
   line-height: 1;
}

   .portal-sidebar-fechar:hover {
      background: rgba(255, 255, 255, .22);
   }

   .portal-sidebar-fechar:focus-visible {
      outline: 2px solid var(--portal-primary);
      outline-offset: 2px;
   }

.portal-create-hint {
   display: block;
   margin-top: 1px;
   color: var(--portal-muted);
   font-size: 10.5px;
   font-weight: 500;
   line-height: 1.2;
}

/* ----------------------------------------------------- search results ----- */

.portal-breadcrumb-sep {
   margin: 0 6px;
   color: #a9c4dc;
}

.portal-search-results {
   position: absolute;
   top: calc(100% + 8px);
   left: 0;
   right: 0;
   z-index: 1080;
   max-height: 320px;
   padding: 6px;
   overflow-y: auto;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-lg);
   background: var(--portal-surface);
   box-shadow: 0 22px 46px rgba(13, 71, 161, .2);
}

.portal-search-result {
   display: flex;
   align-items: center;
   gap: 10px;
   width: 100%;
   padding: 9px 11px;
   border: 0;
   border-radius: var(--radius-md);
   background: transparent;
   color: var(--portal-ink);
   font-family: inherit;
   font-size: 12.5px;
   font-weight: 600;
   line-height: 1.25;
   text-align: left;
}

   .portal-search-result:hover {
      background: var(--portal-primary-ghost);
      color: var(--portal-primary-dark);
   }

.portal-search-result-icon {
   display: inline-flex;
   flex: 0 0 28px;
   width: 28px;
   height: 28px;
   align-items: center;
   justify-content: center;
   overflow: hidden;
   border-radius: var(--radius-sm);
   background: var(--portal-primary-soft);
   color: var(--portal-primary);
   font-size: 11px;
   line-height: 1;
}

   .portal-search-result-icon i {
      display: block;
      width: 1em;
      font-size: 12px;
      line-height: 1;
      text-align: center;
   }

.portal-search-result-label {
   min-width: 0;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.portal-search-empty {
   display: block;
   padding: 14px 12px;
   color: var(--portal-muted);
   font-size: 12px;
   text-align: center;
}

/* ----------------------------------------------------------- dashboard ---- */

.portal-hero {
   position: relative;
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 24px;
   padding: 26px 30px;
   margin-bottom: 18px;
   overflow: hidden;
   border-radius: var(--radius-lg);
   background: var(--portal-hero-gradient-alt);
   color: #fff;
}

   .portal-hero::after {
      content: "";
      position: absolute;
      top: -110px;
      right: -70px;
      width: 300px;
      height: 300px;
      border-radius: 50%;
      background: radial-gradient(circle, var(--portal-glow-primary) 0, transparent 68%);
   }

   .portal-hero > * {
      position: relative;
      z-index: 1;
   }

.portal-hero-eyebrow {
   display: block;
   margin-bottom: 6px;
   color: #d7e8f5;
   font-size: 11px;
   font-weight: 700;
   letter-spacing: .09em;
   text-transform: uppercase;
}

.portal-hero-title {
   margin: 0 0 6px;
   color: #fff;
   font-size: clamp(23px, 2.5vw, 33px);
   font-weight: 800;
   letter-spacing: -.025em;
   line-height: 1.1;
}

.portal-hero-text {
   max-width: 540px;
   margin: 0;
   color: #e4eff8;
   font-size: 13px;
   line-height: 1.55;
}

.portal-hero-actions {
   display: flex;
   flex-wrap: wrap;
   gap: 10px;
}

.portal-pill-button {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   padding: 11px 20px;
   border: 0;
   border-radius: var(--radius-sm);
   background: var(--portal-surface);
   color: var(--portal-ink);
   font-size: 12.5px;
   font-weight: 700;
   white-space: nowrap;
   box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
   transition: transform .15s ease, background .15s ease, color .15s ease;
}

   .portal-pill-button:hover {
      color: var(--portal-primary-dark);
      transform: translateY(-1px);
   }

   .portal-pill-button.is-accent {
      background: var(--portal-primary);
      color: #fff;
   }

      .portal-pill-button.is-accent:hover {
         background: var(--portal-primary-dark);
         color: #fff;
      }

.portal-big-time {
   display: flex;
   align-items: baseline;
   gap: 8px;
   margin-bottom: 14px;
}

.portal-big-time-value {
   font-size: clamp(30px, 3vw, 42px);
   font-weight: 800;
   letter-spacing: -.03em;
   line-height: 1;
   color: var(--portal-ink);
}

.portal-big-time-label {
   color: var(--portal-muted);
   font-size: 11.5px;
   font-weight: 500;
}

.portal-time-list {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
   margin-bottom: 16px;
}

.portal-time-pill {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   padding: 6px 12px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-pill);
   background: var(--portal-card-alt);
   color: var(--portal-ink);
   font-size: 12px;
   font-weight: 600;
}

   .portal-time-pill i {
      color: var(--portal-primary);
      font-size: 10px;
   }

.portal-panel > .dashboard-box-button {
   margin-top: auto !important;
}

.portal-panel-body {
   flex: 1 1 auto;
}

/* Garante um intervalo mínimo entre o conteúdo do cartão e o botão de ação,
   sem perder o alinhamento do botão ao fundo do cartão. */
.portal-panel-body:has(+ .dashboard-box-button) {
   padding-bottom: 20px;
}

.portal-panel .portal-gauge {
   margin-top: 2px;
}

.portal-quick-grid {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 10px;
}

.portal-quick {
   display: flex;
   flex-direction: column;
   gap: 9px;
   padding: 13px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-md);
   background: var(--portal-card-alt);
   color: var(--portal-ink);
   font-size: 12.5px;
   font-weight: 600;
   line-height: 1.25;
   transition: border-color .15s ease, background .15s ease, color .15s ease;
}

   .portal-quick i {
      display: grid;
      width: 34px;
      height: 34px;
      place-items: center;
   border-radius: var(--radius-md);
      background: var(--portal-primary-soft);
      color: var(--portal-primary);
      font-size: 14px;
   }

   .portal-quick:hover {
      background: var(--portal-surface);
      border-color: var(--portal-primary);
      color: var(--portal-primary-dark);
   }

.portal-news-files {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
   margin-top: 10px;
}

.portal-tag {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   padding: 4px 10px;
   border: 1px solid var(--portal-line);
   border-radius: var(--radius-pill);
   background: var(--portal-surface);
   color: var(--portal-muted);
   font-size: 10.5px;
   font-weight: 600;
}

.portal-person-icon {
   margin-left: auto;
   color: var(--portal-primary);
   font-size: 13px;
}

.portal-plugin-widget > * {
   height: 100%;
}

/* ------------------------------------------------------------ responsive --- */


.portal-sidebar-backdrop {
   display: none;
}

@media (max-width: 1180px) {
   .portal-kpi {
      grid-column: span 6;
   }

   .portal-span-3,
   .portal-span-4,
   .portal-span-5 {
      grid-column: span 6;
   }

   .portal-span-7,
   .portal-span-8,
   .portal-span-9 {
      grid-column: span 12;
   }
}

@media (max-width: 991.98px) {
   body.portal-body {
      padding: 0;
   }

   .portal-app {
      min-height: 100vh;
      border-radius: 0;
      box-shadow: none;
   }

   .portal-sidebar {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      z-index: 1050;
      width: min(320px, 86vw);
      max-width: none;
      padding-top: calc(18px + env(safe-area-inset-top));
      padding-bottom: calc(16px + env(safe-area-inset-bottom));
      border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
      transform: translateX(-105%);
      /* "visibility: hidden" retira o menu (e os seus botões) da ordem de
         tabulação enquanto está fechado. */
      visibility: hidden;
      transition: transform .25s ease, visibility .25s ease;
      box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
   }

      .portal-sidebar.is-open {
         transform: translateX(0);
         visibility: visible;
      }

      /* No telemóvel o menu é apresentado sempre por extenso: o estado
         "recolhido" pertence ao desktop e aqui não teria como ser desfeito. */
      .portal-sidebar.is-collapsed {
         flex-basis: auto;
         width: min(320px, 86vw);
         padding-left: 18px;
         padding-right: 18px;
      }

      .portal-sidebar.is-collapsed .portal-brand {
         justify-content: flex-start;
         padding: 4px 8px 0;
      }

      .portal-sidebar.is-collapsed .portal-brand-wordmark,
      .portal-sidebar.is-collapsed .portal-nav-label,
      .portal-sidebar.is-collapsed .portal-create span,
      .portal-sidebar.is-collapsed .portal-nav-chevron,
      .portal-sidebar.is-collapsed .portal-sidebar-user-info {
         display: block;
      }

      .portal-sidebar.is-collapsed .portal-nav-item,
      .portal-sidebar.is-collapsed .portal-nav-group-toggle {
         justify-content: flex-start;
         padding-left: 14px;
         padding-right: 14px;
      }

      .portal-sidebar.is-collapsed .portal-subnav {
         display: flex;
      }

      .portal-sidebar.is-collapsed .portal-create {
         justify-content: flex-start;
         padding: 11px 14px;
      }

      .portal-sidebar-fechar {
         display: grid;
      }

      /* Alvos de toque mais confortáveis nas opções do submenu. */
      .portal-subnav .portal-nav-item {
         padding: 10px 12px;
      }

   .portal-sidebar-backdrop {
      position: fixed;
      inset: 0;
      z-index: 1040;
      display: block;
      background: rgba(7, 25, 45, .45);
      opacity: 0;
      pointer-events: none;
      transition: opacity .25s ease;
   }

      .portal-sidebar-backdrop.is-visible {
         opacity: 1;
         pointer-events: auto;
      }

      /* Enquanto o menu está aberto, a página por trás não deve deslizar. */
      body:has(.portal-sidebar-backdrop.is-visible) {
         overflow: hidden;
      }

   .portal-menu-toggle {
      display: grid;
   }

   .portal-sidebar-toggle {
      display: none;
   }

   .portal-hero {
      flex-direction: column;
      align-items: flex-start;
      padding: 22px;
   }

   /* Em ecrãs estreitos o texto ocupa toda a largura: um véu vertical
      mantém o contraste sobre a parte mais clara do gradiente. */
   .portal-hero::before {
      content: "";
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(6, 26, 43, .34) 0%, rgba(6, 26, 43, .20) 100%);
      pointer-events: none;
   }

   .portal-main {
      padding: 16px 16px 0;
      border-radius: 0;
   }

   .portal-topbar {
      flex-wrap: wrap;
   }

   .portal-topbar-actions {
      flex: 1 1 100%;
      order: 2;
   }

   .portal-search {
      flex: 1 1 auto;
      width: auto;
   }

   .portal-auth {
      grid-template-columns: 1fr;
      min-height: 100vh;
      border-radius: 0;
   }

   .portal-auth-brand {
      display: none;
   }
}

@media (max-width: 767.98px) {
   .portal-kpi,
   .portal-span-3,
   .portal-span-4,
   .portal-span-5,
   .portal-span-6,
   .portal-span-7,
   .portal-span-8,
   .portal-span-9 {
      grid-column: span 12;
   }

   .subheader .subheader-title {
      font-size: 22px !important;
   }

   .portal-search {
      display: none;
   }

   .portal-topbar-actions {
      display: none;
   }

   .portal-content {
      padding-bottom: 20px;
   }

   .dashboard-box {
      padding: 16px;
   }
}

/* ---------------------------------------------------- reduced animations --- */

@media (prefers-reduced-motion: reduce) {
   *,
   *::before,
   *::after {
      transition: none !important;
      animation: none !important;
   }
}

/* ============================================================================
   Tema escuro
   Aplicado por <html data-theme="dark">. O atributo é definido em App.razor
   (antes das folhas de estilo, para não haver um clarão do tema claro) e
   alterado pelo botão de Definições (portal-scripts.js).
   ============================================================================ */

html[data-theme="dark"] {
   color-scheme: dark;

   --portal-bg: #08141f;
   --portal-shell: #0e1f2e;
   --portal-card: #162c3f;
   --portal-card-alt: #1b3349;
   --portal-surface: #162c3f;
   --portal-surface-alt: #1c3549;
   --portal-head-ink: #9fb8cf;
   --portal-disabled-surface: #1c3549;
   --portal-news-ink: #e9f2fa;
   --portal-ink: #e9f2fa;
   --portal-muted: #93aabf;
   --portal-line: #26445f;
   /* Tons suaves derivados da paleta (funciona com qualquer tema de cor). */
   --portal-primary-soft: color-mix(in srgb, var(--portal-primary) 24%, #162c3f);
   --portal-primary-ghost: color-mix(in srgb, var(--portal-primary) 12%, #0e1f2e);
   --portal-green-soft: #16351f;
   --portal-blue-soft: color-mix(in srgb, var(--portal-primary) 24%, #162c3f);
   --portal-sand: #1a3448;
   --shadow-soft: 0 12px 34px rgba(0, 0, 0, .45);
   --shadow-card: 0 6px 18px rgba(0, 0, 0, .35);
   --accent: color-mix(in srgb, var(--portal-primary) 55%, #ffffff);
   --accent-light: color-mix(in srgb, var(--portal-primary) 70%, #ffffff);

   /* Destaque mais profundo no tema escuro, para não ofuscar. */
   --portal-hero-gradient:
      linear-gradient(180deg, rgba(0, 0, 0, .22) 0%, rgba(0, 0, 0, .34) 58%, rgba(0, 0, 0, .26) 100%),
      linear-gradient(155deg,
         color-mix(in srgb, var(--portal-primary) 20%, #0b1b2b) 0%,
         color-mix(in srgb, var(--portal-primary) 40%, #0b1b2b) 55%,
         color-mix(in srgb, var(--portal-primary) 58%, #0b1b2b) 100%);
   --portal-hero-gradient-alt:
      linear-gradient(100deg, rgba(0, 0, 0, .30) 0%, rgba(0, 0, 0, .12) 55%, rgba(0, 0, 0, 0) 85%),
      linear-gradient(120deg,
         color-mix(in srgb, var(--portal-primary) 24%, #0b1b2b) 0%,
         color-mix(in srgb, var(--portal-primary) 48%, #0b1b2b) 55%,
         color-mix(in srgb, var(--portal-primary) 68%, #0b1b2b) 100%);
}

html[data-theme="dark"] body,
html[data-theme="dark"] body.portal-body {
   color: var(--portal-ink);
   background-color: #08141f;
   background-image:
      radial-gradient(circle at 8% 4%, color-mix(in srgb, var(--portal-primary) 10%, transparent) 0, transparent 38%),
      radial-gradient(circle at 92% 96%, color-mix(in srgb, var(--portal-primary) 7%, transparent) 0, transparent 42%),
      linear-gradient(135deg, #0a1725 0%, #0f2233 45%, #081521 100%);
}

html[data-theme="dark"] body.portal-body::before {
   opacity: .16;
   background-image: repeating-linear-gradient(135deg,
         rgba(255, 255, 255, .06) 0 1px,
         transparent 1px 26px);
}

/* Pesquisa da barra superior ---------------------------------------------- */

html[data-theme="dark"] .portal-search input {
   border-color: rgba(255, 255, 255, .12);
   background: rgba(255, 255, 255, .08);
   color: var(--portal-ink);
   box-shadow: none;
}

   html[data-theme="dark"] .portal-search input::placeholder {
      color: rgba(233, 242, 250, .5);
   }

   html[data-theme="dark"] .portal-search input:focus {
      background: rgba(255, 255, 255, .14);
   }

html[data-theme="dark"] .portal-search-results {
   border-color: var(--portal-line);
}

/* Controlos de formulário -------------------------------------------------- */

html[data-theme="dark"] .form-control::placeholder,
html[data-theme="dark"] .form-select::placeholder {
   color: rgba(233, 242, 250, .45);
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
   background: var(--portal-surface);
   color: var(--portal-ink);
}

/* Botões outline: a cor primária da paleta pode ser demasiado escura sobre o
   fundo escuro (ex.: violeta). Usa-se um tom claro derivado da primária, sem
   depender de --accent-light, que é substituído pelas paletas. */
html[data-theme="dark"] .btn-outline-primary {
   border-color: color-mix(in srgb, var(--portal-primary) 60%, #ffffff);
   color: color-mix(in srgb, var(--portal-primary) 55%, #ffffff);
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-primary:focus {
   border-color: color-mix(in srgb, var(--portal-primary) 60%, #ffffff);
   background: color-mix(in srgb, var(--portal-primary) 60%, #ffffff);
   color: #08141f;
}

html[data-theme="dark"] .btn-outline-primary:disabled {
   border-color: var(--portal-line);
   color: var(--portal-muted);
}

/* Componentes DevExpress --------------------------------------------------- */

html[data-theme="dark"] .dxbl-text-edit,
html[data-theme="dark"] .dxbl-combobox,
html[data-theme="dark"] .dxbl-spin-edit,
html[data-theme="dark"] .dxbl-memo-edit,
html[data-theme="dark"] .dxbl-edit {
   background-color: var(--portal-surface);
   border-color: var(--portal-line);
   color: var(--portal-ink);
}

/* Ícones dos editores (calendário, limpar, seta) herdam a cor do texto. */
html[data-theme="dark"] .dxbl-text-edit .dxbl-btn-group,
html[data-theme="dark"] .dxbl-text-edit .dxbl-edit-btn-dropdown,
html[data-theme="dark"] .dxbl-text-edit .dxbl-edit-btn-clear,
html[data-theme="dark"] .dxbl-combobox .dxbl-btn-group,
html[data-theme="dark"] .dxbl-combobox .dxbl-edit-btn-dropdown {
   background-color: transparent;
   border-color: transparent;
   color: var(--portal-ink);
}

html[data-theme="dark"] .dxbl-text-edit .dxbl-btn-group svg,
html[data-theme="dark"] .dxbl-text-edit .dxbl-edit-btn-dropdown svg,
html[data-theme="dark"] .dxbl-text-edit .dxbl-edit-btn-clear svg,
html[data-theme="dark"] .dxbl-combobox svg {
   fill: currentColor;
   color: var(--portal-ink);
}

html[data-theme="dark"] .dxbl-text-edit input,
html[data-theme="dark"] .dxbl-combobox input {
   color: var(--portal-ink);
}

html[data-theme="dark"] .dxbl-popup,
html[data-theme="dark"] .dxbl-dropdown,
html[data-theme="dark"] .dxbl-listbox,
html[data-theme="dark"] .dxbl-grid {
   background-color: var(--portal-surface);
   border-color: var(--portal-line);
   color: var(--portal-ink);
}

html[data-theme="dark"] .dxbl-listbox-item:hover {
   background-color: var(--portal-card-alt);
}

/* Superfícies comuns do Bootstrap ----------------------------------------- */

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .toast {
   border-color: var(--portal-line);
   background-color: var(--portal-card);
   color: var(--portal-ink);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus {
   background-color: var(--portal-card-alt);
   color: var(--portal-ink);
}

/* Alertas ------------------------------------------------------------------ */

html[data-theme="dark"] .alert {
   border: 0;
   box-shadow: none;
}

html[data-theme="dark"] .alert-warning {
   background: #3a2f16;
   color: #f0d08a;
}

html[data-theme="dark"] .alert-success {
   background: #17331f;
   color: #9fdaad;
}

html[data-theme="dark"] .alert-danger {
   background: #3a1d1d;
   color: #f0a7a7;
}

/* Mapa de férias ----------------------------------------------------------- */

html[data-theme="dark"] .mapa-ferias-dia.is-meio {
   background: #24486a !important;
   color: #e9f2fa;
}

/* Autenticação (login) ----------------------------------------------------- */

html[data-theme="dark"] .portal-auth-form {
   background: var(--portal-shell);
}
/* Notícias: o HTML vem do editor de texto e pode trazer cores próprias
   (texto escuro) que ficam ilegíveis em fundo escuro. Em modo escuro o texto
   passa a usar a cor do tema; os links mantêm destaque. */
html[data-theme="dark"] .portal-news-item .ql-editor,
html[data-theme="dark"] .portal-news-item .ql-editor * {
   color: var(--portal-ink) !important;
}

   html[data-theme="dark"] .portal-news-item .ql-editor a,
   html[data-theme="dark"] .portal-news-item .ql-editor a * {
      color: color-mix(in srgb, var(--portal-primary) 60%, #ffffff) !important;
      text-decoration: underline;
   }

/* Etiquetas sobre fundos suaves da paleta */

html[data-theme="dark"] .portal-absence-pill {
   color: var(--portal-ink);
}

/* Detalhe de processamento: agrupadores de períodos (definidos em site.css) */

html[data-theme="dark"] .periodos .agrupador.falta {
   background-image: linear-gradient(color-mix(in srgb, var(--portal-danger) 12%, var(--portal-card)),
         color-mix(in srgb, var(--portal-danger) 6%, var(--portal-card)));
}

html[data-theme="dark"] .periodos .agrupador.suplementar {
   background-image: linear-gradient(color-mix(in srgb, var(--portal-primary) 14%, var(--portal-card)),
         color-mix(in srgb, var(--portal-primary) 6%, var(--portal-card)));
}

html[data-theme="dark"] .periodos .agrupador.trabalho {
   background-image: linear-gradient(color-mix(in srgb, var(--portal-green) 12%, var(--portal-card)),
         color-mix(in srgb, var(--portal-green) 5%, var(--portal-card)));
}
/* KPIs em modo escuro: tons escuros derivados da paleta (substituem os tons
   pastel do modo claro, que aqui ficariam ilegíveis). */

html[data-theme="dark"] .portal-kpi.kpi-green {
   background: color-mix(in srgb, var(--portal-green) 14%, var(--portal-card));
   border-color: color-mix(in srgb, var(--portal-green) 30%, var(--portal-card));
}

html[data-theme="dark"] .portal-kpi.kpi-peach {
   background: color-mix(in srgb, var(--portal-primary) 10%, var(--portal-card));
   border-color: color-mix(in srgb, var(--portal-primary) 26%, var(--portal-card));
}

html[data-theme="dark"] .portal-kpi.kpi-blue {
   background: color-mix(in srgb, var(--portal-primary) 16%, var(--portal-card));
   border-color: color-mix(in srgb, var(--portal-primary) 34%, var(--portal-card));
}

html[data-theme="dark"] .portal-kpi.kpi-sand {
   background: color-mix(in srgb, var(--portal-primary) 6%, var(--portal-card));
   border-color: color-mix(in srgb, var(--portal-primary) 22%, var(--portal-card));
}

html[data-theme="dark"] .portal-kpi-icon {
   background: rgba(255, 255, 255, .08);
}

html[data-theme="dark"] .portal-kpi.kpi-sand .portal-kpi-icon {
   color: var(--portal-ink);
}
