/* =========================================================
   EcoModelAI — Estrutura visual da plataforma
   Layout sólido, navegação definida e superfícies discretas.
   Depende das variáveis de theme.css.
   ========================================================= */

.session-status {
  display: grid;
  min-height: 100svh;
  padding: 24px;
  place-items: center;
  color: var(--color-text-muted);
  text-align: center;
}

/* =========================================================
   Estrutura principal
   ========================================================= */

.platform-layout {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  min-height: 100svh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: 100svh;
  max-height: 100svh;
  overflow-y: auto;
  padding: 30px 18px 20px;
  border-right: 1px solid #cdd5c5;
  background: #e8edE2;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--color-background);
}

/* =========================================================
   Identidade
   ========================================================= */

.brand {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  margin: 0 10px;
  border-radius: 5px;
  color: var(--color-text);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.9px;
  text-decoration: none;
}

.brand-symbol {
  display: grid;
  width: 39px;
  height: 39px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid #bdc9b4;
  border-radius: 10px;
  color: #42543a;
  background: #d5dfcb;
}

.brand-symbol svg {
  width: 27px;
  height: 27px;
}

.brand-accent {
  color: var(--color-primary);
}

/* =========================================================
   Navegação lateral
   ========================================================= */

.sidebar-label {
  margin: 43px 13px 14px;
  color: #596650;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.main-navigation {
  display: grid;
  gap: 6px;
}

.navigation-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 49px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #4d5946;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.navigation-link:hover {
  color: #34432e;
  background: rgba(255, 255, 255, 0.55);
}

.navigation-link.is-active {
  border-color: #70434b;
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 3px 8px rgba(112, 67, 75, 0.1);
}

.navigation-symbol {
  width: 23px;
  flex-shrink: 0;
  font-size: 23px;
  line-height: 1;
  text-align: center;
}

/* =========================================================
   Conta e encerramento de sessão
   ========================================================= */

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: auto 12px 25px;
  padding-top: 55px;
}

.sidebar-note-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  margin-top: 6px;
  border-radius: 2px;
  background: #647b58;
}

.sidebar-note p {
  margin: 0;
  color: #596650;
  font-size: 11px;
  line-height: 1.8;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 19px 7px 15px;
  border-top: 1px solid #c9d2c1;
}

.account-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid #c5cebd;
  border-radius: 8px;
  color: #42543a;
  background: #f5f7f0;
  font-size: 13px;
  font-weight: 750;
}

.account-details {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.account-label {
  color: #596650;
  font-size: 10px;
}

.account-details strong {
  overflow-wrap: anywhere;
  color: #34432e;
  font-size: 11px;
  font-weight: 650;
}

.logout-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #4d5946;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.logout-button:hover:not(:disabled) {
  border-color: #c9d2c1;
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.6);
}

.logout-button:disabled {
  opacity: 0.65;
}

/* =========================================================
   Cabeçalho
   ========================================================= */

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 94px;
  padding: 22px 38px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.workspace-header .eyebrow {
  margin: 0 0 6px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 1.6px;
}

.header-location {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.workspace-header .badge {
  padding: 7px 11px;
  border: 1px solid #cdd5c5;
  border-radius: 5px;
  font-size: 10px;
  letter-spacing: 0.2px;
}

.workspace-main {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 38px;
}

/* =========================================================
   Apresentação
   ========================================================= */

.welcome-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid #d7c6c3;
  border-radius: 10px;
  background: #eee0dd;
}

.welcome-copy {
  position: relative;
  z-index: 1;
  padding: 34px 36px;
  border-left: 5px solid var(--color-primary);
}

.welcome-copy .eyebrow {
  margin: 0 0 18px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.6px;
}

.welcome-copy h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(29px, 2.7vw, 41px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -1.5px;
  text-wrap: balance;
}

.welcome-description {
  max-width: 460px;
  margin: 20px 0 25px;
  color: #665a55;
  font-size: 13px;
  line-height: 1.85;
}

.welcome-copy .button {
  min-height: 44px;
  gap: 22px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
}

/* Composição geométrica inspirada em volumes arquitetónicos. */

.welcome-art {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid rgba(136, 86, 94, 0.12);
  background:
    linear-gradient(
      rgba(136, 86, 94, 0.055) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(136, 86, 94, 0.055) 1px,
      transparent 1px
    ),
    #e8e8dc;
  background-size: 32px 32px;
}

.art-orbit {
  position: absolute;
  top: 35px;
  left: 14%;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(82, 98, 71, 0.22);
  border-radius: 50%;
}

.art-shape {
  position: absolute;
  border: 1px solid rgba(57, 45, 41, 0.12);
  box-shadow: 10px 14px 0 rgba(57, 45, 41, 0.045);
}

.art-shape--rose {
  right: 42%;
  bottom: 58px;
  width: 83px;
  height: 150px;
  border-radius: 40px 40px 2px 2px;
  background: #c58f91;
}

.art-shape--sage {
  right: 15%;
  bottom: 58px;
  width: 94px;
  height: 200px;
  border-radius: 3px;
  background: #a8b69a;
}

.art-shape--ivory {
  right: 32%;
  bottom: 58px;
  width: 87px;
  height: 90px;
  border-radius: 2px;
  background: #f7f3ee;
}

.art-caption {
  position: absolute;
  right: 18px;
  bottom: 19px;
  left: 18px;
  color: #596650;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
}

/* =========================================================
   Secção de ferramentas
   ========================================================= */

.tools-section {
  margin-top: 34px;
  scroll-margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 19px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--color-border);
}

.section-heading .eyebrow {
  margin: 0 0 8px;
  font-size: 9px;
  font-weight: 750;
}

.section-heading h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.8px;
}

.section-heading > p {
  max-width: 240px;
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 27px;
  border: 1px solid #d5cbc4;
  border-top: 4px solid var(--color-primary);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: 0 3px 10px rgba(57, 45, 41, 0.025);
}

.tool-card--monitor {
  border-top-color: #647b58;
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tool-number {
  color: var(--color-primary);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.4px;
}

.tool-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #e6d3d5;
  border-radius: 8px;
  color: var(--color-primary);
  background: var(--color-primary-soft);
  font-size: 27px;
}

.tool-card--monitor .tool-number {
  color: var(--color-sage-dark);
}

.tool-card--monitor .tool-icon {
  border-color: #d6dfce;
  color: var(--color-sage-dark);
  background: var(--color-sage-soft);
}

.tool-card h3 {
  margin: 20px 0 12px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.9px;
}

.tool-description {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.8;
}

.tool-features {
  display: grid;
  gap: 0;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.tool-features li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eee8e2;
  font-size: 12px;
  line-height: 1.6;
}

.tool-features li:last-child {
  border-bottom: 0;
}

.tool-features li::before {
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-radius: 1px;
  background: var(--color-primary);
  content: "";
}

.tool-card--monitor .tool-features li::before {
  background: #647b58;
}

.tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 47px;
  margin-top: auto;
  padding: 11px 15px;
  border: 1px solid #dfc9cd;
  border-radius: 5px;
  color: var(--color-primary);
  background: #f7eeef;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.tool-link span {
  font-size: 21px;
  font-weight: 400;
}

.tool-link:hover {
  color: var(--color-primary-hover);
  background: #eedde0;
}

.tool-card--monitor .tool-link {
  border-color: #cdd8c4;
  color: var(--color-sage-dark);
  background: #eff3e9;
}

.tool-card--monitor .tool-link:hover {
  color: #34432e;
  background: #e2ead9;
}

/* =========================================================
   Notas e mensagens
   ========================================================= */

.demo-notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid #d6dbcd;
  border-left: 3px solid #879977;
  border-radius: 5px;
  background: #eef1e8;
}

.demo-notice-symbol {
  display: grid;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid #a8b69a;
  border-radius: 50%;
  color: var(--color-sage-dark);
  font-size: 12px;
  font-weight: 700;
}

.demo-notice h2 {
  margin: 0 0 5px;
  color: var(--color-sage-dark);
  font-size: 12px;
  font-weight: 700;
}

.demo-notice p {
  margin: 0;
  color: #596650;
  font-size: 11px;
  line-height: 1.8;
}

#platform-message:empty {
  display: none;
}

#platform-message:not(:empty) {
  padding: 15px;
  border: 1px solid #e5c0c2;
  border-radius: 5px;
  color: var(--color-danger);
  background: var(--color-danger-soft);
  font-size: 13px;
}

/* =========================================================
   Rodapé
   ========================================================= */

.workspace-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding: 20px 38px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 10px;
}

/* =========================================================
   Adaptação a ecrãs intermédios
   ========================================================= */

@media (max-width: 1150px) {
  .platform-layout {
    grid-template-columns: 225px minmax(0, 1fr);
  }

  .sidebar {
    padding-right: 13px;
    padding-left: 13px;
  }

  .brand {
    gap: 8px;
    font-size: 20px;
  }

  .workspace-header,
  .workspace-main {
    padding-right: 25px;
    padding-left: 25px;
  }

  .welcome-card {
    grid-template-columns: 1.5fr 0.65fr;
  }

  .welcome-copy {
    padding: 28px;
  }

  .welcome-copy h1 {
    font-size: 31px;
  }

  .art-shape--sage {
    right: 8%;
    width: 75px;
  }

  .art-shape--rose {
    right: 45%;
    width: 70px;
  }

  .art-shape--ivory {
    right: 30%;
    width: 72px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .section-heading > p {
    max-width: none;
  }

  .tool-card {
    padding: 22px;
  }

  .tool-card h3 {
    font-size: 22px;
  }

  .workspace-footer {
    padding-right: 25px;
    padding-left: 25px;
  }
}

/* =========================================================
   Menu superior em tablets e telemóveis
   ========================================================= */

@media (max-width: 850px) {
  .platform-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid #cdd5c5;
  }

  .brand {
    margin: 0;
  }

  .sidebar-label,
  .sidebar-note {
    display: none;
  }

  .main-navigation {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 20px;
  }

  .navigation-link {
    justify-content: center;
    gap: 7px;
    padding: 10px 8px;
    font-size: 11px;
    text-align: center;
  }

  .sidebar-account {
    margin-top: 16px;
    padding: 13px 0 0;
  }

  .logout-button {
    align-self: flex-end;
    margin-top: 5px;
  }

  .workspace-header {
    min-height: 85px;
  }

  .welcome-card {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

@media (max-width: 600px) {
  .workspace-header {
    flex-wrap: wrap;
    gap: 13px;
    padding: 20px;
  }

  .workspace-main {
    padding: 20px;
  }

  .welcome-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .welcome-copy {
    padding: 25px;
  }

  .welcome-copy h1 {
    font-size: 29px;
  }

  .welcome-art {
    display: none;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .navigation-link {
    flex-direction: column;
    gap: 7px;
    font-size: 10px;
  }

  .navigation-symbol {
    font-size: 21px;
  }

  .demo-notice {
    padding: 16px;
  }

  .workspace-footer {
    padding: 18px 20px;
  }
}
