/* Fontes servidas pelo próprio site (sem pedidos ao Google — RGPD).
   Coloque os ficheiros em public/fonts/ (ver docs/FONTES.md).
   Sem esses ficheiros, o navegador usa a fonte do sistema. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src:
    local('DM Sans'),
    url('fonts/dm-sans-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src:
    local('Manrope'),
    url('fonts/manrope-latin-wght-normal.woff2') format('woff2');
}
:root {
  /* Esquema de cores (Configurações → Cores): matiz e intensidade da cor principal. */
  --h: 345;
  --sf: 1;
  --green: hsl(var(--h) calc(var(--sf) * 58.8%) 20.0%);
  --lime: hsl(var(--h) calc(var(--sf) * 41.2%) 90.0%);
  --bg: #f5f3f4;
  --muted: #7a817b;
  --line: hsl(var(--h) calc(var(--sf) * 5.5%) 89.2%);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: hsl(var(--h) calc(var(--sf) * 9.3%) 16.9%);
  font:
    14px 'DM Sans',
    system-ui,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  background: var(--green);
  color: white;
  padding: 12px 18px;
  border-radius: 9px;
  font-weight: 600;
  min-height: 44px;
}
button:hover {
  filter: brightness(1.1);
}
.secondary {
  background: white;
  color: var(--green);
  border: 1px solid var(--line);
}
.iconbtn {
  background: transparent;
  color: inherit;
  padding: 8px;
  font-size: 23px;
}
.shell {
  margin-left: 238px;
}
aside {
  width: 238px;
  position: fixed;
  inset: 0 auto 0 0;
  background: hsl(var(--h) calc(var(--sf) * 58.8%) 20.0%);
  color: hsl(var(--h) calc(var(--sf) * 8.5%) 88.4%);
  padding: 36px 22px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.logo {
  font:
    800 33px Manrope,
    sans-serif;
  letter-spacing: -2px;
  color: #fff;
}
.logo span {
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -1px;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 2px;
  margin: 8px 0 42px;
  color: hsl(var(--h) calc(var(--sf) * 8.0%) 70.6%);
}
.navlabel {
  font-size: 10px;
  letter-spacing: 2px;
  color: hsl(var(--h) calc(var(--sf) * 7.8%) 60.0%);
  margin: 18px 12px 10px;
}
aside button {
  background: none;
  text-align: left;
  color: hsl(var(--h) calc(var(--sf) * 7.6%) 76.7%);
  margin: 3px 0;
  width: 100%;
  display: flex;
  gap: 13px;
  font-weight: 500;
}
aside button.active {
  background: hsl(var(--h) calc(var(--sf) * 41.2%) 90.0%);
  color: hsl(var(--h) calc(var(--sf) * 58.8%) 20.0%);
}
aside .end {
  margin-top: auto;
  padding-top: 36px;
  font-size: 12px;
  color: hsl(var(--h) calc(var(--sf) * 8.0%) 73.1%);
}
header {
  height: 84px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 20px;
  /* Mesma largura e margens do conteúdo (main): a conta fica alinhada com o corpo. */
  padding: 0 28px;
  max-width: 1600px;
  box-sizing: border-box;
  background: #fff;
}
.breadcrumb {
  font-size: 10px;
  letter-spacing: 1.3px;
  flex: 1;
  font-weight: 700;
}
.breadcrumb span {
  color: #90958e;
  font-weight: 400;
  letter-spacing: 0;
}
.private {
  font-size: 12px;
  color: hsl(var(--h) calc(var(--sf) * 6.3%) 40.2%);
}
.avatar {
  background: hsl(var(--h) calc(var(--sf) * 8.0%) 90.2%);
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.brand-mobile {
  display: none;
}
main {
  /* Encostado à barra lateral (antes ficava centrado em ecrãs largos, longe do menu). */
  padding: 28px 28px;
  max-width: 1600px;
  margin: 0;
}
h1,
h2,
h3 {
  font-family: Manrope, system-ui, sans-serif;
}
h1 {
  font-size: 30px;
  letter-spacing: -1.1px;
  margin: 7px 0 8px;
}
h2 {
  font-size: 18px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 15px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 1.7px;
  font-weight: 700;
  color: hsl(var(--h) calc(var(--sf) * 7.6%) 51.2%);
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.top p {
  color: var(--muted);
  margin: 0;
}
.top .buttons {
  display: flex;
  gap: 10px;
}
.demo {
  background: hsl(var(--h) calc(var(--sf) * 7.3%) 92.0%);
  border: 1px solid hsl(var(--h) calc(var(--sf) * 5.9%) 86.7%);
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 22px;
  color: hsl(var(--h) calc(var(--sf) * 5.5%) 39.0%);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px;
}
.stat .label {
  display: flex;
  justify-content: space-between;
  color: hsl(var(--h) calc(var(--sf) * 6.2%) 47.3%);
  font-size: 12px;
}
.stat strong {
  display: block;
  font:
    700 32px Manrope,
    system-ui,
    sans-serif;
  margin: 13px 0 8px;
  letter-spacing: -1px;
}
.stat small {
  color: hsl(var(--h) calc(var(--sf) * 7.9%) 53.1%);
  font-size: 11px;
}
.stat:first-child {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.stat:first-child .label,
.stat:first-child small {
  color: hsl(var(--h) calc(var(--sf) * 7.1%) 78.0%);
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
  gap: 22px;
}
.panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.panel-head {
  padding: 20px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  margin: 0;
}
.link {
  color: hsl(var(--h) calc(var(--sf) * 57.6%) 36.1%);
  background: none;
  font-size: 12px;
  padding: 5px;
}
.event {
  display: flex;
  align-items: center;
  gap: 17px;
  padding: 20px 22px;
  border-bottom: 1px solid #efeded;
}
.event:last-child {
  border: 0;
}
.date {
  background: #efeded;
  width: 48px;
  min-width: 48px;
  text-align: center;
  padding: 9px 3px;
  border-radius: 9px;
}
.date strong {
  display: block;
  font-size: 19px;
}
.date small {
  font-size: 9px;
  text-transform: uppercase;
}
.event .info {
  flex: 1;
  min-width: 0;
}
.event h3 {
  margin: 0 0 6px;
}
.event p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.badge {
  display: inline-block;
  font-size: 10px;
  padding: 5px 9px;
  border-radius: 5px;
  background: hsl(var(--h) calc(var(--sf) * 7.0%) 91.6%);
  color: hsl(var(--h) calc(var(--sf) * 57.6%) 36.1%);
  white-space: nowrap;
}
.badge.amber {
  background: #faf1da;
  color: #a37a24;
}
.badge.blue {
  background: #e9eef9;
  color: #5b71a1;
}
.sidecontent {
  padding: 6px 22px 20px;
}
.notice {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.notice:last-child {
  border: 0;
}
.notice strong {
  font-size: 13px;
  display: block;
  margin-bottom: 6px;
}
.notice p {
  font-size: 12px;
  line-height: 1.6;
  margin: 0;
  color: var(--muted);
}
.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.quick button {
  background: hsl(var(--h) calc(var(--sf) * 7.3%) 92.0%);
  color: hsl(var(--h) calc(var(--sf) * 5.6%) 28.2%);
  text-align: left;
  font-size: 12px;
  padding: 18px;
}
.quick b {
  display: block;
  font-size: 20px;
  margin-bottom: 10px;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 22px;
}
.search {
  flex: 1;
  max-width: 480px;
}
.toolbar input,
.toolbar select {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  width: 100%;
}
.records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.record {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px;
}
.record h3 {
  margin: 10px 0 14px;
  font-size: 18px;
}
.details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 15px 0;
}
.details small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 5px;
}
.details span {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.record-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.record-foot button {
  font-size: 12px;
  padding: 8px 12px;
}
.danger {
  background: #faf0ed;
  color: #a35b4a;
}
.empty {
  text-align: center;
  padding: 55px;
  background: white;
  border-radius: 12px;
  color: var(--muted);
}
footer {
  padding: 15px 28px 30px;
  font-size: 10px;
  color: #939b90;
}
#bottom {
  display: none;
}
dialog {
  border: 0;
  border-radius: 16px;
  padding: 25px;
  width: 540px;
  max-width: calc(100% - 24px);
  max-height: 90dvh;
  box-shadow: 0 30px 100px #0004;
}
dialog::backdrop {
  background: hsl(var(--h) calc(var(--sf) * 58.5%) 10.4% / 0.69);
  backdrop-filter: blur(4px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h2 {
  margin: 0 0 15px;
}
#fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
label[hidden] {
  display: none;
}
label {
  font-size: 12px;
  color: hsl(var(--h) calc(var(--sf) * 5.7%) 41.6%);
  display: block;
}
label input,
label select,
label textarea {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid hsl(var(--h) calc(var(--sf) * 7.0%) 86.1%);
  border-radius: 8px;
  margin-top: 6px;
  background: white;
  color: hsl(var(--h) calc(var(--sf) * 9.3%) 16.9%);
  min-height: 46px;
}
.wide {
  grid-column: 1/-1;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
#error {
  color: #b44c37;
  font-size: 13px;
}
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: hsl(var(--h) calc(var(--sf) * 58.8%) 20.0%);
  color: white;
  border-radius: 10px;
  padding: 14px 24px;
  display: none;
  z-index: 10;
  box-shadow: 0 4px 25px #0003;
}
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.dayhead {
  text-align: center;
  padding: 14px;
  font-size: 11px;
  color: var(--muted);
  background: hsl(var(--h) calc(var(--sf) * 8.1%) 92.7%);
}
.day {
  min-height: 113px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.day.today {
  background: hsl(var(--h) calc(var(--sf) * 9.7%) 93.9%);
}
.day .num {
  font-size: 12px;
}
.cal-event {
  display: block;
  padding: 6px;
  margin: 5px 0 0;
  background: hsl(var(--h) calc(var(--sf) * 5.9%) 90.0%);
  color: hsl(var(--h) calc(var(--sf) * 5.6%) 31.6%);
  border-radius: 4px;
  font-size: 10px;
  min-height: 0;
  width: 100%;
  text-align: left;
  overflow: hidden;
}
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}
.menu-grid button {
  background: white;
  color: var(--green);
  border: 1px solid var(--line);
  padding: 25px;
  text-align: left;
}
.progress {
  height: 5px;
  border-radius: 4px;
  background: hsl(var(--h) calc(var(--sf) * 7.7%) 92.4%);
  margin-top: 12px;
}
.progress i {
  display: block;
  background: hsl(var(--h) calc(var(--sf) * 7.9%) 57.8%);
  height: 5px;
  border-radius: 4px;
}
@media (min-width: 1500px) {
  main {
    padding-top: 45px;
  }
}
@media (max-width: 1050px) {
  aside {
    width: 200px;
    padding: 30px 14px;
  }
  .shell {
    margin-left: 200px;
  }
  main {
    padding: 28px 24px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .stats {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 27px;
  }
  header {
    padding: 0 24px;
  }
  .records {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  aside {
    display: none;
  }
  .shell {
    margin: 0;
  }
  header {
    height: 68px;
    padding: 0 20px;
    gap: 12px;
  }
  .brand-mobile {
    display: block;
    flex: 1;
    font:
      800 24px Manrope,
      system-ui,
      sans-serif;
    letter-spacing: -1px;
  }
  .brand-mobile span {
    font-weight: 400;
    font-size: 18px;
  }
  .breadcrumb {
    display: none;
  }
  .private {
    font-size: 10px;
  }
  .avatar {
    width: 30px;
    height: 30px;
  }
  main {
    padding: 25px 18px 18px;
  }
  h1 {
    font-size: 27px;
  }
  .top {
    align-items: flex-start;
    margin-bottom: 22px;
  }
  .top p {
    font-size: 12px;
    line-height: 1.6;
  }
  .top .buttons {
    gap: 6px;
  }
  .top button {
    padding: 10px 12px;
    font-size: 12px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 28px;
    margin: 10px 0 6px;
  }
  .stat .label {
    font-size: 11px;
  }
  .demo {
    font-size: 10px;
    line-height: 1.6;
  }
  .demo span:last-child {
    display: none;
  }
  .event {
    padding: 17px 15px;
    gap: 12px;
  }
  .event h3 {
    font-size: 13px;
  }
  .event p {
    font-size: 10px;
    line-height: 1.6;
  }
  .event .badge {
    font-size: 9px;
    padding: 5px;
  }
  .panel-head {
    padding: 17px;
  }
  .panel-head h2 {
    font-size: 16px;
  }
  .grid {
    gap: 18px;
  }
  .quick {
    gap: 7px;
  }
  .quick button {
    padding: 14px 10px;
    font-size: 10px;
  }
  .records {
    gap: 12px;
  }
  .record {
    padding: 18px;
  }
  footer {
    padding: 16px 20px 105px;
    line-height: 1.7;
  }
  #bottom {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fffefb;
    border-top: 1px solid var(--line);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    z-index: 5;
    justify-content: space-around;
  }
  #bottom button {
    background: none;
    color: hsl(var(--h) calc(var(--sf) * 8.1%) 56.5%);
    font-size: 9px;
    padding: 5px;
    width: 20%;
    border-radius: 8px;
    font-weight: 500;
  }
  #bottom button.active {
    color: hsl(var(--h) calc(var(--sf) * 58.5%) 26.5%);
    background: hsl(var(--h) calc(var(--sf) * 8.1%) 92.7%);
  }
  #bottom b {
    display: block;
    font-size: 21px;
    font-weight: 400;
    margin-bottom: 4px;
  }
  #toast {
    bottom: 100px;
    width: calc(100% - 40px);
    text-align: center;
    font-size: 12px;
  }
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  #fields {
    gap: 12px;
  }
  dialog {
    padding: 20px;
  }
  .day {
    min-height: 78px;
    padding: 5px;
  }
  .dayhead {
    padding: 12px 0;
    font-size: 9px;
  }
  .cal-event {
    font-size: 8px;
    padding: 4px;
    overflow-wrap: anywhere;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar button {
    padding: 10px;
  }
  .calendar {
    border-radius: 8px;
  }
  .details {
    gap: 12px;
  }
  .menu-grid {
    gap: 10px;
  }
}
.loan-modal {
  width: 720px;
  padding: 0;
}
.loan-modal .modal-head {
  padding: 24px 26px 15px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
}
.loan-modal .modal-head h2 {
  margin: 0;
}
.loan-modal #fields {
  display: block;
  padding: 0 26px;
}
.form-intro {
  padding: 22px 0 4px;
}
.form-intro p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}
.form-section {
  margin: 20px 0;
  background: #f7f5f6;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}
.section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.section-title > span {
  background: hsl(var(--h) calc(var(--sf) * 8.5%) 88.4%);
  color: hsl(var(--h) calc(var(--sf) * 57.8%) 35.3%);
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  padding: 9px;
}
.section-title h3 {
  margin: 0 0 5px;
}
.section-title p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.section-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-note {
  font-size: 11px;
  line-height: 1.7;
  color: #7a817b;
  grid-column: 1/-1;
  margin: 0;
}
.loan-modal .actions {
  position: sticky;
  bottom: 0;
  background: white;
  padding: 18px 26px;
  border-top: 1px solid var(--line);
}
.loan-modal #error {
  margin: 12px 26px;
}
.loan-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.loan-material {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: hsl(var(--h) calc(var(--sf) * 9.1%) 93.5%);
  padding: 14px;
  border-radius: 8px;
  font-size: 12px;
}
.loan-summary {
  display: flex;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 15px 0;
  font-size: 11px;
  color: hsl(var(--h) calc(var(--sf) * 5.8%) 47.5%);
}
.loan-summary b {
  font-size: 17px;
  color: hsl(var(--h) calc(var(--sf) * 58.5%) 26.5%);
  margin-right: 3px;
}
.loan-summary .damage,
.loan-summary .damage b {
  color: #aa6640;
}
.return-history {
  border-top: 1px solid var(--line);
  padding: 13px 0;
  font-size: 12px;
}
.return-history summary {
  cursor: pointer;
  color: hsl(var(--h) calc(var(--sf) * 57.8%) 32.5%);
  min-height: 28px;
}
.history-item {
  border-left: 2px solid hsl(var(--h) calc(var(--sf) * 6.7%) 85.3%);
  padding: 5px 12px;
  margin: 12px 0;
}
.history-item p {
  line-height: 1.8;
  color: var(--muted);
}
input[readonly],
select:disabled {
  background: hsl(var(--h) calc(var(--sf) * 7.0%) 91.6%);
  color: hsl(var(--h) calc(var(--sf) * 5.9%) 46.7%);
}
@media (max-width: 700px) {
  .loan-modal {
    max-width: 100%;
    width: 100%;
    height: 94dvh;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }
  .loan-modal .modal-head {
    padding: 20px 18px 14px;
  }
  .loan-modal #fields {
    padding: 0 16px;
  }
  .form-section {
    padding: 15px;
    margin: 16px 0;
  }
  .section-fields {
    grid-template-columns: 1fr;
  }
  .loan-modal .actions {
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .loan-modal .actions button {
    flex: 1;
  }
  .loan-card .record-foot {
    flex-wrap: wrap;
  }
  .loan-card .record-foot > button:first-child {
    flex: 1;
  }
  .loan-summary {
    gap: 12px;
    flex-wrap: wrap;
  }
}
.shift-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 12px;
  margin-bottom: 22px;
}
.shift-filters select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: hsl(var(--h) calc(var(--sf) * 6.4%) 30.6%);
  min-height: 46px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 700px) {
  .shift-filters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .shift-filters label:last-child {
    grid-column: 1/-1;
  }
}
/* Integrated operations retain the original CCT design system. */
aside {
  overflow-y: auto;
  padding-top: 24px;
}
aside .brand-sub {
  margin-bottom: 15px;
}
aside .navlabel {
  margin-top: 12px;
}
aside button {
  padding: 8px 12px;
  min-height: 40px;
}
aside .end {
  padding-top: 16px;
}
.panel {
  margin-bottom: 18px;
}
.panel-body {
  padding: 18px 22px;
}
.panel-body > .event {
  padding-left: 0;
  padding-right: 0;
}
.panel-body > .panel {
  margin-top: 16px;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.badge.red {
  background: #fae2dd;
  color: #943f32;
}
.critical {
  border-left: 3px solid #bc654e;
  padding-left: 12px;
}
.notice p {
  font-size: 13px;
}
.date-picker {
  max-width: 200px;
}
.toolbar {
  flex-wrap: wrap;
}
.toolbar > input {
  width: auto;
  flex: 1;
}
.form-content {
  padding: 24px 0;
}
.form-content input[type='checkbox'] {
  width: 24px;
  height: 24px;
  min-height: 24px;
}
.form-content .wide > p {
  line-height: 1.7;
}
.form-content select[multiple] {
  min-height: 110px;
}
.loan-line {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.loan-material {
  align-items: center;
  margin: 8px 0;
}
.record-foot {
  flex-wrap: wrap;
}
.schedule-person {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.person-header {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.work-line {
  padding: 9px 0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.work-line button {
  min-height: 36px;
  padding: 6px 10px;
}
.hours {
  font-size: 12px;
  line-height: 1.8;
  color: hsl(var(--h) calc(var(--sf) * 6.2%) 34.7%);
  background: hsl(var(--h) calc(var(--sf) * 9.1%) 93.5%);
  padding: 10px;
  border-radius: 6px;
}
.table-scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  background: hsl(var(--h) calc(var(--sf) * 9.1%) 93.5%);
}
.financial-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.financial-metrics > div {
  background: white;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.financial-metrics small {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}
.financial-metrics strong {
  font-size: 20px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  max-height: 360px;
  overflow: auto;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding-top: 12px;
}
.link {
  text-align: left;
  font-size: 13px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid hsl(var(--h) calc(var(--sf) * 7.6%) 48.8%);
  outline-offset: 2px;
}
#global-results:empty {
  display: none;
}
.calendar-scroll {
  overflow: auto;
}
.top .buttons {
  flex-wrap: wrap;
}
.demo {
  gap: 12px;
  align-items: center;
}
.panel-body > .menu-grid button {
  padding: 16px;
}
@media (max-width: 700px) {
  .panel-body {
    padding: 15px;
  }
  .financial-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .financial-metrics > div {
    padding: 12px;
  }
  .financial-metrics strong {
    font-size: 18px;
  }
  .top {
    flex-wrap: wrap;
  }
  .top .buttons {
    width: 100%;
  }
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .calendar-scroll .calendar {
    min-width: 690px;
  }
  .calendar-scroll .cal-event {
    font-size: 11px;
    min-height: 44px;
  }
  .loan-line {
    grid-template-columns: minmax(0, 2fr) minmax(80px, 1fr);
  }
  .loan-line button {
    grid-column: 1/-1;
  }
  .toolbar {
    gap: 7px;
  }
  .toolbar .search {
    min-width: 220px;
    max-width: none;
  }
  .details {
    grid-template-columns: 1fr 1fr;
  }
  .demo {
    display: block;
  }
  .demo button {
    margin-top: 8px;
  }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .tabs button {
    flex-shrink: 0;
  }
  .menu-grid {
    grid-template-columns: 1fr 1fr;
  }
  .panel-body > .menu-grid button {
    padding: 14px;
    font-size: 12px;
  }
  .section-fields {
    grid-template-columns: 1fr;
  }
  .form-content {
    padding-top: 18px;
  }
  .record-foot button {
    flex-grow: 1;
  }
  main {
    padding-bottom: 30px;
  }
}

.external-button {
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  background: hsl(var(--h) calc(var(--sf) * 58.8%) 20.0%);
  color: white;
  border-radius: 9px;
  text-decoration: none;
  min-height: 44px;
}
#auth-form label,
#password-form label,
#user-form label {
  margin-bottom: 16px;
}
/* Operational dashboard and account corrections, using the existing CCT palette. */
.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.dashboard-actions a {
  font-weight: 600;
  font-size: 14px;
}
.day-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--green);
  color: #fff;
  border-radius: 12px;
  margin-bottom: 24px;
  padding: 22px;
  gap: 22px;
}
.day-summary strong {
  display: block;
  font:
    700 23px Manrope,
    sans-serif;
  overflow-wrap: anywhere;
}
.day-summary span {
  display: block;
  color: hsl(var(--h) calc(var(--sf) * 6.7%) 85.3%);
  font-size: 12px;
  margin-top: 7px;
}
.dashboard-grid > div {
  min-width: 0;
}
.priority-list .notice {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.priority-list .notice > div {
  flex: 1;
  min-width: 0;
}
.priority-list .notice p {
  margin-top: 7px;
  color: hsl(var(--h) calc(var(--sf) * 6.5%) 30.2%);
}
.priority-list button {
  flex-shrink: 0;
}
.priority-list summary,
.account-page summary {
  padding: 14px 0;
  cursor: pointer;
  min-height: 44px;
  font-weight: 600;
}
.opening-closing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}
.opening-closing p {
  line-height: 1.7;
}
.account-main {
  max-width: 950px;
  margin: auto;
  padding-bottom: 40px;
}
.account-page .record {
  display: block;
}
.account-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.account-page label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.account-page input,
.account-page select {
  width: 100%;
  min-height: 44px;
}
.account-page .buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.user-edit {
  margin-top: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.account-page .account-error {
  color: #a42f32;
}
.account-page #message {
  min-height: 24px;
}
.account-history-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.account-page button:disabled {
  opacity: 0.6;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid hsl(var(--h) calc(var(--sf) * 57.6%) 36.1%);
  outline-offset: 3px;
}
@media (max-width: 650px) {
  .day-summary {
    grid-template-columns: 1fr 1fr;
    padding: 18px;
    gap: 18px;
  }
  .day-summary strong {
    font-size: 20px;
  }
  .dashboard-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .dashboard-actions button,
  .dashboard-actions a {
    padding: 12px 10px;
    text-align: center;
    justify-content: center;
  }
  .priority-list .notice {
    align-items: stretch;
    flex-direction: column;
  }
  .priority-list .notice button {
    align-self: flex-start;
  }
  .account-fields {
    grid-template-columns: 1fr;
  }
  .account-page input,
  .account-page select,
  .account-page textarea {
    font-size: 16px;
  }
  .opening-closing {
    grid-template-columns: 1fr;
  }
  .account-main {
    padding: 24px 18px 40px;
  }
  .account-page .record {
    padding: 18px;
  }
  .account-page .buttons button {
    flex: 1;
  }
}
.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-card h3 .link {
  font-size: 16px;
  text-align: left;
  padding-left: 0;
}
.task-overdue {
  border-left: 4px solid #ad3737;
}
.task-blocker {
  background: #fff4de;
  padding: 12px;
  border-radius: 8px;
  color: #795724;
}
.task-note {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.task-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.task-dashboard-list .notice {
  padding: 13px 0;
}
.task-dashboard-list .notice p {
  margin-bottom: 9px;
}
.task-card .record-foot {
  flex-wrap: wrap;
}
.history-item ul {
  padding-left: 20px;
  overflow-wrap: anywhere;
}
.task-card p {
  line-height: 1.6;
}

/* Ficha técnica */
.sheet .panel {
  margin-top: 14px;
}
.sheet h3 {
  font-size: 14px;
  margin: 12px 0 6px;
}
.sheet-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.sheet-row:last-child {
  border-bottom: 0;
}
.sheet .pre {
  white-space: pre-wrap;
}
button.check {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 6px 0;
  min-height: 40px;
  font-weight: 500;
  text-align: left;
}
.check-row.done button.check,
.check-row.done > span {
  color: var(--muted);
  text-decoration: line-through;
}
#print-area {
  display: none;
}
@media print {
  body.printing > *:not(#print-area) {
    display: none !important;
  }
  body.printing #print-area {
    display: block;
    padding: 0;
  }
  body {
    background: white;
  }
  #print-area h1 {
    font-size: 20px;
    margin: 0 0 6px;
  }
  #print-area .no-print {
    display: none !important;
  }
  #print-area .panel {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
    margin-top: 10px;
  }
  #print-area button.link,
  #print-area button.check {
    min-height: 0;
    padding: 0;
    color: inherit;
  }
}

.pre {
  white-space: pre-wrap;
}

/* Informação à Assembleia Municipal */
.report-title {
  font-size: 22px;
  margin: 18px 0 4px;
}
.table-wrap {
  overflow-x: auto;
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.report-table th,
.report-table td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.report-table th {
  font-weight: 700;
  color: var(--muted);
}
@media print {
  #print-area .day-summary {
    background: none;
    color: inherit;
    border: 1px solid #ccc;
  }
  #print-area .report-table {
    font-size: 11px;
  }
}

/* Cores dos espaços no calendário */
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c, #999);
  margin: 0 5px 0 2px;
  vertical-align: middle;
  flex: none;
}
.cal-event.spaced {
  background: color-mix(in srgb, var(--c) 13%, white);
  border-left: 4px solid var(--c);
  color: hsl(var(--h) calc(var(--sf) * 9.6%) 14.3%);
}
.cal-event.spaced:hover {
  background: color-mix(in srgb, var(--c) 22%, white);
}
.event.spaced {
  padding-left: 16px;
  border-left: 5px solid var(--c);
  background: color-mix(in srgb, var(--c) 5%, white);
}
.space-tag {
  white-space: nowrap;
  margin-right: 8px;
}
.space-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}
.legend-chip {
  background: white;
  color: hsl(var(--h) calc(var(--sf) * 9.3%) 16.9%);
  border: 1px solid var(--line);
  min-height: 36px;
  padding: 6px 12px;
  font-weight: 500;
  font-size: 13px;
}
.legend-chip.active {
  border-color: hsl(var(--h) calc(var(--sf) * 9.3%) 16.9%);
  box-shadow: inset 0 0 0 1px hsl(var(--h) calc(var(--sf) * 9.3%) 16.9%);
}
@media print {
  .cal-event.spaced,
  .event.spaced {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}

/* Planear semana */
.wp-scroll {
  overflow-x: auto;
  margin-bottom: 14px;
}
.week-plan {
  border-collapse: collapse;
  min-width: 1100px;
  width: 100%;
  background: #fff;
}
.week-plan th,
.week-plan td {
  border: 1px solid var(--line);
  padding: 6px;
  vertical-align: top;
  text-align: left;
}
.week-plan thead th.today {
  background: hsl(var(--h) calc(var(--sf) * 41.2%) 90.0%);
}
.week-plan tbody th {
  position: sticky;
  left: 0;
  background: #fff;
  min-width: 150px;
  z-index: 1;
}
.week-plan tbody th small {
  display: block;
  color: var(--muted);
  font-weight: 400;
  margin-top: 4px;
}
.wp-cell {
  min-width: 140px;
}
.wp-cell select,
.wp-cell input {
  display: block;
  box-sizing: border-box;
  margin: 0 0 4px;
  width: 100%;
  min-height: 34px;
  padding: 4px 6px;
  font-size: 12px;
  margin: 2px 0;
}
.wp-cell small {
  display: block;
  font-size: 11px;
  margin-top: 3px;
}
.wp-work {
  background: hsl(var(--h) calc(var(--sf) * 9.7%) 93.9%);
}
.wp-absent {
  background: #faf1da;
}
.wp-locked {
  color: #5b71a1;
}
.wp-alert {
  color: #943f32;
  font-weight: 600;
}

#fields label[hidden],
.form-grid label[hidden] {
  display: none !important;
}

/* Férias e pedidos */
.vac-map {
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}
.vac-map th,
.vac-map td {
  border: 1px solid var(--line);
  text-align: center;
  min-width: 26px;
  height: 30px;
  padding: 2px;
}
.vac-map thead th {
  font-weight: 600;
  line-height: 1.15;
}
.vac-map thead th.today {
  background: var(--lime);
}
.vac-map tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  text-align: left;
  min-width: 150px;
  padding: 4px 8px;
}
.vac-map tbody th small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
.vac-off {
  background: #eeecec;
  color: var(--muted);
}
.vac-f {
  background: hsl(var(--h) calc(var(--sf) * 58.4%) 30.2%);
  color: #fff;
  font-weight: 700;
}
.vac-h {
  background: linear-gradient(135deg, hsl(var(--h) calc(var(--sf) * 58.4%) 30.2%) 50%, hsl(var(--h) calc(var(--sf) * 7.9%) 85.1%) 50%);
  color: #fff;
  font-weight: 700;
}
.vac-p {
  background: #f6dd9a;
  color: #6b4b00;
  font-weight: 700;
}
.vac-a {
  background: #dfe6f3;
  color: #44577f;
}
.vac-legend span {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  padding: 2px 4px;
  margin: 0 4px 0 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.vac-legend span:first-child {
  margin-left: 0;
}
.leave-request .buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.leave-warnings {
  margin: 6px 0 0;
  padding-left: 18px;
  color: #943f32;
}

/* A minha semana */
.mine-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 20px;
}
.mine-day {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 120px;
}
.mine-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}
.mine-day.today {
  border-color: var(--green);
  box-shadow: inset 0 3px 0 var(--green);
}
.mine-day.mine-off {
  background: #fbf6e8;
}
.mine-day.mine-changed {
  outline: 2px solid #c0573e;
}
.mine-hours {
  font-weight: 600;
  margin: 4px 0;
}
.mine-day p {
  margin: 4px 0;
}
.mine-event small,
.mine-task small {
  display: block;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .mine-week {
    grid-template-columns: 1fr;
  }
  .mine-day {
    min-height: 0;
  }
}
.leave-main {
  flex: 1;
}
.leave-line {
  margin: 6px 0 2px !important;
  color: inherit !important;
  font-size: 13px !important;
}
.leave-request {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Público e bilheteira */
.box-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.box-kpis div {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
}
.box-kpis strong {
  display: block;
  font-size: 20px;
}
.box-kpis span {
  font-size: 12px;
  color: var(--muted);
}
.box-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.box-row small {
  display: block;
}
.box-bar {
  width: 90px;
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.box-bar span {
  display: block;
  height: 100%;
  background: var(--green);
}
.hours-record {
  display: block;
  margin: 2px 0;
}
.hours-actions .secondary,
.hours-actions button {
  margin: 2px 4px 2px 0;
}
.clock-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

/* Cedências: orçamento */
.quote-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.quote-table th,
.quote-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: left;
}
.quote-table td:nth-child(n + 2),
.quote-table th:nth-child(n + 2),
.quote-table tfoot td:last-child {
  text-align: right;
}
.quote-table tfoot td {
  font-weight: 600;
}
.quote-table .quote-total td {
  font-size: 15px;
  border-top: 2px solid var(--green);
}
#rental-prices input,
#rental-prices select {
  width: 100%;
  min-width: 90px;
}

/* Permissões por área */
.permissions-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}
.permissions-table th,
.permissions-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
  text-align: center;
  vertical-align: top;
}
.permissions-table td:first-child,
.permissions-table th:first-child {
  text-align: left;
}
.permissions-table small {
  display: block;
  color: var(--muted);
  font-weight: 400;
}
.permissions-form {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.permissions-table input[type='radio'] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

/* Ajuda */
.help-btn {
  min-width: 40px;
  font-weight: 700;
  border-radius: 999px;
}
.help-dialog {
  max-width: 560px;
  width: calc(100% - 32px);
  border: 0;
  border-radius: 16px;
  padding: 20px 24px;
}
.help-dialog::backdrop {
  background: rgb(0 0 0 / 0.35);
}
.help-dialog .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 16px;
}
.help-steps,
.help-lines {
  padding-left: 22px;
  line-height: 1.55;
}
.help-steps li,
.help-lines li {
  margin: 4px 0;
}
.faq-list,
.help-results {
  display: grid;
  gap: 6px;
}
.faq-item,
.help-item {
  text-align: left;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  color: inherit;
  cursor: pointer;
}
.faq-item:hover,
.help-item:hover {
  background: var(--bg);
}
.help-item span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}
.help-article {
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.help-article summary {
  cursor: pointer;
  font-weight: 600;
}
#toast .link {
  color: inherit;
  text-decoration: underline;
  margin-left: 6px;
}
.loan-group {
  font-size: 1.05rem;
  margin: 18px 0 8px;
}
.stock-table td small {
  display: block;
}
.stock-table tr.stock-out td {
  background: #fbeceb;
}
.stock-table tr.stock-low td {
  background: #fdf6e6;
}
.stock-neg {
  color: #a1352b;
  font-weight: 700;
}
.att-input {
  width: 90px;
}
aside .end {
  text-align: left;
}
.sidebar-logo {
  display: block;
  width: 83px;
  height: auto;
  margin: 8px 0 12px;
  opacity: 0.92;
}
@media print {
  .sidebar-logo {
    display: none;
  }
}
aside button.nav-toggle {
  min-height: 0;
  padding: 0;
  margin: 18px 12px 10px;
  width: auto;
  font-size: 10px;
  letter-spacing: 2px;
  color: hsl(var(--h) calc(var(--sf) * 7.8%) 60.0%);
  font-weight: 400;
  cursor: pointer;
}
aside button.nav-toggle:hover {
  color: hsl(var(--h) calc(var(--sf) * 8.5%) 88.4%);
}
.account-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}
.account-link #account-name {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.account-link #account-name small {
  font-size: 11px;
  color: hsl(var(--h) calc(var(--sf) * 6.3%) 40.2%);
}
.account-link .avatar {
  font-weight: 700;
  color: hsl(var(--h) calc(var(--sf) * 58.8%) 20.0%);
}
@media (max-width: 700px) {
  .account-link #account-name {
    display: none;
  }
}
/* Erro ao guardar: campo em causa assinalado e mensagem em destaque. */
#fields label.field-error input,
#fields label.field-error select,
#fields label.field-error textarea {
  border-color: #b44c37;
  box-shadow: 0 0 0 3px rgba(180, 76, 55, 0.18);
}
#fields label.field-error {
  color: #b44c37;
}
#error:not(:empty) {
  background: #fbeceb;
  border: 1px solid #f0c9c2;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 600;
}
#error.flash {
  animation: error-flash 0.9s ease;
}
@keyframes error-flash {
  0% {
    background: #f6c9c0;
  }
  100% {
    background: #fbeceb;
  }
}
.loan-modal #error:not(:empty) {
  position: sticky;
  bottom: 84px;
  z-index: 2;
}
.team-week {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13px;
}
.team-week th,
.team-week td {
  border: 1px solid var(--line);
  padding: 8px;
  vertical-align: top;
  text-align: left;
}
.team-week th[scope='row'] small,
.team-week td small {
  display: block;
}
.team-week th[scope='row'] small {
  color: hsl(var(--h) calc(var(--sf) * 6.3%) 40.2%);
  font-weight: 400;
}
.team-week .today {
  background: #f3f1f2;
}
.team-week td.team-off {
  background: #f6f1e4;
}
.team-abs {
  color: #9a6a14;
  font-weight: 600;
}
.team-ev {
  margin-top: 4px;
}
.event-team {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 8px 0;
}
.event-team small {
  color: hsl(var(--h) calc(var(--sf) * 6.3%) 40.2%);
  margin-right: 2px;
}
.event-team span {
  background: #eeecec;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
}
.checks-field {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.checks-field legend {
  font-size: 13px;
  padding: 0 4px;
}
.checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 14px;
}
.checks .check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
}
.checks .check input {
  width: auto;
  margin-top: 3px;
}
.checks .check small {
  display: block;
  color: hsl(var(--h) calc(var(--sf) * 6.3%) 40.2%);
}

/* Cartaz do evento */
.record .poster-thumb { float: right; width: 64px; height: 90px; object-fit: cover; border-radius: 6px; margin: 0 0 8px 10px; background: var(--line, #eee); }
.poster-field { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.poster-field .poster-thumb { width: 72px; height: 100px; object-fit: cover; border-radius: 6px; }
.poster-field label { flex: 1; min-width: 220px; }
.poster-large { display: block; max-width: 220px; max-height: 320px; width: auto; border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.sheet .poster-sheet { float: right; width: 90px; height: 128px; object-fit: cover; border-radius: 6px; margin: 0 0 10px 14px; }

/* Versão nova disponível */
.app-version { display: block; opacity: .7; font-size: 11px; margin-top: 2px; }
.update-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; display: flex; gap: 14px; align-items: center; background: hsl(var(--h) calc(var(--sf) * 58.8%) 20.0%); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); flex-wrap: wrap; }
.update-bar button { background: hsl(var(--h) calc(var(--sf) * 41.2%) 90.0%); color: hsl(var(--h) calc(var(--sf) * 58.8%) 20.0%); border: 0; border-radius: 8px; padding: 8px 12px; font-weight: 600; cursor: pointer; }

/* Eventos: vistas e intervalo de datas */
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.inline-field input[type="date"] { width: auto; }
.check-inline input { width: auto; margin: 0; }
.event-search input[type="search"] { flex: 1; min-width: 220px; }
.event-total { margin: 4px 0 10px; }


/* Searchable Select (lista com pesquisa) */
.ss { position: relative; margin-top: 6px; }
.ss-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.ss-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 5px 62px 5px 8px; border: 1px solid hsl(var(--h) calc(var(--sf) * 7.0%) 86.1%); border-radius: 8px; background: white; cursor: text; position: relative; }
.ss-box::after { content: '▾'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: hsl(var(--h) calc(var(--sf) * 5.7%) 41.6%); pointer-events: none; font-size: 13px; }
.ss.is-open .ss-box { border-color: var(--green); box-shadow: 0 0 0 3px hsl(var(--h) calc(var(--sf) * 58.8%) 20.0% / .12); }
.ss-invalid .ss-box { border-color: #b4462f; }
label .ss .ss-input, .ss .ss-input { flex: 1; min-width: 120px; border: 0; margin: 0; padding: 6px 4px; min-height: 34px; background: transparent; outline: none; font-size: 16px; color: hsl(var(--h) calc(var(--sf) * 9.3%) 16.9%); box-shadow: none; }
.ss-clear { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); min-height: 0; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: transparent; color: hsl(var(--h) calc(var(--sf) * 5.7%) 41.6%); font-size: 18px; line-height: 1; }
.ss-clear[hidden] { display: none; }
.ss-chips { display: contents; }
.ss-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--lime); color: var(--green); border-radius: 999px; padding: 4px 4px 4px 10px; font-size: 13px; font-weight: 600; }
.ss-chip button { min-height: 0; width: 22px; height: 22px; padding: 0; border-radius: 50%; background: transparent; color: var(--green); font-size: 16px; line-height: 1; }
.ss-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: white; border: 1px solid hsl(var(--h) calc(var(--sf) * 7.0%) 86.1%); border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); max-height: min(300px, 45vh); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ss-up .ss-list { top: auto; bottom: calc(100% + 4px); }
.ss-list li { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 12px; border-radius: 8px; font-size: 15px; color: hsl(var(--h) calc(var(--sf) * 9.3%) 16.9%); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ss-list li.is-active, .ss-list li:hover { background: hsl(var(--h) calc(var(--sf) * 58.8%) 20.0% / .07); }
.ss-list li.is-selected { font-weight: 700; color: var(--green); }
.ss-list li.ss-empty { color: var(--muted); cursor: default; }
.ss-check { width: 18px; height: 18px; flex: none; border: 1px solid hsl(var(--h) calc(var(--sf) * 7.5%) 73.7%); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: white; }
.is-selected .ss-check { background: var(--green); border-color: var(--green); }
.toolbar .ss, .filter-grid .ss { min-width: 180px; }

/* Assinatura «© lbra»: discreta, fixa no fundo da barra lateral (desktop) e no fundo do
   menu expandido (telemóvel). Não interfere com a navegação. */
aside { padding-bottom: 0; }
.app-signature {
  flex: none;
  margin: 0 -22px;
  padding: 10px 22px 14px;
  background: inherit;
  border-top: 1px solid hsl(var(--h) calc(var(--sf) * 30%) 30% / 0.6);
  color: hsl(var(--h) calc(var(--sf) * 8.5%) 88.4% / 0.42);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
/* A barra lateral: a lista de menus desliza; a assinatura fica sempre visível no fundo. */
aside { overflow: hidden !important; }
aside .nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  margin: 0 -22px;
  padding: 0 22px 16px;
  scrollbar-width: thin;
}
@media (max-width: 1050px) {
  .app-signature { margin: 0 -14px; padding: 10px 14px 14px; }
  aside .nav-scroll { margin: 0 -14px; padding: 0 14px 16px; }
}
.app-signature-mobile { display: none; }
@media (max-width: 700px) {
  .app-signature-mobile {
    display: block;
    position: static;
    margin: 18px 0 8px;
    padding: 0;
    background: none;
    border: 0;
    text-align: center;
    color: #a3aca5;
  }
}
@media print {
  .app-signature { display: none; }
}

/* Agenda: equipa afeta a cada marcação */
.agenda-team { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.team-chip { display: inline-flex; gap: 4px; align-items: baseline; background: #f0eeef; color: hsl(var(--h) calc(var(--sf) * 10.4%) 18.8%); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.team-chip.ext { background: hsl(var(--h) calc(var(--sf) * 35.1%) 92.7%); color: hsl(var(--h) calc(var(--sf) * 57.4%) 26.7%); }
.team-chip small { color: #6b726e; }
.team-none { font-size: 12px; color: #9a5a00; background: #fff4e0; border-radius: 999px; padding: 3px 10px; }
.cal-team { display: block; font-size: 10.5px; opacity: .85; margin-top: 2px; white-space: normal; }
.cal-team.none { font-style: italic; }

/* Pedidos (Multimédia / Reparações) */
.req-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 18px; }
.req-stats .stat { background: #fff; color: #2a2427; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 0; font-weight: 500; }
.req-stats .stat strong { font-size: 28px; color: var(--green); }
.req-stats .stat span { font-size: 13px; color: hsl(var(--h) calc(var(--sf) * 3.4%) 40.6%); }
.req-stats .stat:hover { filter: none; border-color: var(--green); }
.req-stats .stat.stat-alert { border-color: #c0573e; background: #fdf3f1; }
.req-stats .stat.stat-alert strong { color: #a1352b; }
.req-filters input[type="search"] { flex: 1; min-width: 200px; }
.req-number { color: var(--green); font-variant-numeric: tabular-nums; }
.section-fields > .wide, .req-detail { min-width: 0; }
.req-detail p, .req-detail span { overflow-wrap: anywhere; }
.req-detail .panel { margin-top: 14px; }
.req-description { background: #f7f5f6; border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.req-comment { border-bottom: 1px solid var(--line); padding: 8px 0; }
.req-comment:last-child { border-bottom: 0; }
@media (max-width: 700px) {
  .req-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .req-stats .stat { padding: 10px 12px; border-radius: 12px; }
  .req-stats .stat strong { font-size: 22px; }
}
/* No computador, a pesquisa das listas usa a mesma letra dos outros campos (no telemóvel
   mantém 16 px para o iPhone não aproximar o ecrã). */
@media (min-width: 701px) and (hover: hover) {
  label .ss .ss-input, .ss .ss-input { font-size: 14px; }
  .filter-grid .ss .ss-input, .toolbar .ss .ss-input { font-size: 12px; }
}

/* Multimédia: leitor (painel fixo) e biblioteca */
.mm-dock { margin: 0 44px; padding: 16px; background: #141113; color: #eee; border-radius: 16px; display: grid; grid-template-columns: minmax(260px, 46%) 1fr; gap: 18px; align-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); margin-top: 22px; }
.mm-dock[hidden] { display: none; }
.mm-monitor { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; }
.mm-monitor video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.mm-monitor canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mm-dock:not(.mm-video) .mm-monitor video { opacity: 0; }
.mm-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #8f8a8c; font-size: 13px; text-align: center; padding: 10px; }
.mm-empty[hidden] { display: none; }
.mm-monitor:fullscreen { border-radius: 0; }
.mm-panel { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.mm-now b { display: block; font-size: 17px; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-now small { color: #b9b3b5; }
.mm-seek { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; font-size: 12px; color: #c9c3c5; }
.mm-seek input { flex: 1; }
.mm-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mm-controls button { min-height: 40px; padding: 8px 12px; font-size: 15px; }
.mm-controls button.secondary { background: #2a2527; color: #eee; border-color: #3a3436; }
.mm-controls button.on { background: var(--green); color: #fff; }
.mm-controls #mm-playbtn { min-width: 52px; background: var(--lime); color: var(--green); font-size: 18px; }
.mm-controls input[type="range"] { width: 110px; }
.mm-controls select { width: auto; min-height: 40px; background: #2a2527; color: #eee; border: 1px solid #3a3436; border-radius: 8px; padding: 0 8px; }
.mm-seek input[type="range"], .mm-controls input[type="range"] { accent-color: var(--lime); }
.mm-close { margin-left: auto; }
/* Fora da página Multimédia: barra compacta (a reprodução continua). */
.mm-dock.mm-compact { position: fixed; z-index: 60; left: 254px; right: 16px; bottom: 16px; margin: 0; grid-template-columns: 160px 1fr; padding: 10px; gap: 12px; }
.mm-dock.mm-compact .mm-controls button[data-mm="back"], .mm-dock.mm-compact .mm-controls button[data-mm="fwd"], .mm-dock.mm-compact #mm-rate { display: none; }
.lib-filters input[type="search"] { flex: 1; min-width: 200px; }
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-row { display: grid; grid-template-columns: 44px 1fr auto auto minmax(0, 180px) auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.lib-row.is-playing { border-color: var(--green); box-shadow: 0 0 0 2px var(--lime) inset; }
.lib-play { width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; font-size: 15px; }
.lib-info { min-width: 0; display: flex; flex-direction: column; }
.lib-info b, .lib-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-info small, .lib-dur, .lib-event { color: #6b6466; font-size: 12px; }
.lib-dur { font-variant-numeric: tabular-nums; }
.lib-event { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-kind { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #eceaeb; color: #4a4446; }
.lib-kind.v { background: var(--lime); color: var(--green); }
.lib-sheet { min-height: 36px; padding: 6px 12px; }
.upload-progress { display: flex; align-items: center; gap: 10px; }
.upload-progress progress { flex: 1; height: 10px; accent-color: var(--green); }
@media (max-width: 1050px) { .mm-dock { margin-left: 24px; margin-right: 24px; } .mm-dock.mm-compact { left: 216px; } }
@media (max-width: 700px) {
  .mm-dock { margin: 12px; grid-template-columns: 1fr; padding: 12px; }
  .mm-dock.mm-compact { left: 8px; right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); grid-template-columns: 1fr; }
  .mm-dock.mm-compact .mm-monitor { display: none; }
  .mm-dock.mm-compact.mm-video .mm-monitor { display: block; max-height: 30vh; }
  .mm-controls input[type="range"] { width: 90px; }
  .lib-row { grid-template-columns: 40px 1fr auto; }
  .lib-row .lib-kind, .lib-row .lib-event { display: none; }
  .lib-row .lib-sheet { grid-column: 2 / 4; justify-self: start; }
}
@media print { .mm-dock { display: none !important; } }
.req-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.req-gallery img, .req-gallery video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #000; display: block; }
body.mm-docked main { padding-bottom: 170px; }
@media (max-width: 700px) { body.mm-docked main { padding-bottom: 230px; } }

/* --- Spotify e Biblioteca Musical --------------------------------------------------------- */
.sp-terms { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: hsl(var(--h) calc(var(--sf) * 8%) 95%); color: #555; font-size: 13px; }
.sp-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.4fr); gap: 0; }
.sp-user, .sp-now, .sp-row { display: flex; gap: 12px; align-items: center; }
.sp-row { padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sp-row:last-of-type { border-bottom: 0; }
.sp-cover { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: #eee; display: inline-grid; place-items: center; color: #999; font-size: 22px; }
.sp-now .sp-cover { width: 84px; height: 84px; border-radius: 12px; }
.sp-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 200px; }
.sp-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-search { display: grid; gap: 10px; margin-bottom: 8px; }
.sp-search input[type=search] { width: 100%; font-size: 16px; padding: 12px 14px; border-radius: 12px; }
.sp-pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 12px; }
.sp-progress { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin: 14px 0 6px; font-variant-numeric: tabular-nums; font-size: 13px; }
.sp-progress input, .sp-volume input { width: 100%; accent-color: var(--green); }
.sp-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sp-controls button { min-width: 48px; min-height: 44px; font-size: 18px; border-radius: 999px; }
.sp-controls .sp-main { min-width: 60px; }
.sp-volume { display: flex; align-items: center; gap: 8px; flex: 1 1 160px; font-size: 13px; }
.sp-device { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 12px; }
.sp-device label { flex: 1 1 200px; }
@media (max-width: 760px) {
  .sp-terms { margin: 0 0 12px; }
  .sp-grid { grid-template-columns: 1fr; }
  .sp-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .sp-actions > * { min-height: 38px; padding: 6px 4px; font-size: 12.5px; text-align: center; white-space: normal; line-height: 1.15; }
  .sp-cover { width: 48px; height: 48px; }
}
.upload-progress[hidden], .meta-note[hidden] { display: none !important; }
.loan-number { font-weight: 700; font-size: 13px; letter-spacing: .04em; color: var(--green); font-variant-numeric: tabular-nums; }

/* Mapa anual de férias da equipa: um quadro por mês com todos os dias */
.ym-resume td, .ym-resume th { vertical-align: top; }
.ym-month { margin-top: 18px; break-inside: avoid; }
.ym-month h3 { margin: 0 0 6px; font-size: 15px; }
.ym-days th, .ym-days td { min-width: 24px; height: 26px; padding: 1px; font-size: 11px; }
.ym-days tbody th { min-width: 140px; }
.ym-num { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.ym-foot th, .ym-foot td { background: #faf8f8; font-size: 11px; font-weight: 600; color: var(--muted); }
.ym-foot td.ym-many { color: #8a5a00; background: #fbecc4; }
.print-only { display: none; }
@media print {
  #print-area .print-only { display: block; font-size: 18px; margin: 0 0 8px; }
  #print-area .ym-days th, #print-area .ym-days td { min-width: 0; height: 16px; font-size: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-area .ym-days tbody th { min-width: 90px; }
  #print-area .ym-month { break-inside: avoid; }
  #print-area .table-scroll { overflow: visible; }
}
