:root {
  --brand-green: #17684f;
  --brand-green-dark: #11533f;
  --brand-green-soft: #e3eee9;
  --ink: #687080;
  --ink-dark: #4e5666;
  --panel: #eff0f2;
  --panel-hover: #626b7c;
  --white: #ffffff;
  --orbit-gray: #b8bac0;
  --orbit-core: rgba(122, 128, 140, 0.64);
  --shadow: 0 14px 32px rgba(42, 50, 63, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--brand-green);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--brand-green);
  color: var(--ink);
  font-family:
    "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-frame {
  min-height: 100vh;
  min-height: 100svh;
  padding: 28px 30px 0;
  background: var(--brand-green);
}

.app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 28px);
  min-height: calc(100svh - 28px);
  overflow: hidden;
  background: var(--white);
  border-radius: 15px 15px 0 0;
}

.topbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 72px;
  padding: 16px 24px 8px;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: transform 160ms ease;
}

.brand:hover {
  transform: translateY(-1px);
}

.brand:focus-visible,
.module-button:focus-visible,
.gerencial-hub:focus-visible,
.sector:focus-visible,
.tehokas-brand:focus-visible {
  outline: 3px solid rgba(23, 104, 79, 0.35);
  outline-offset: 4px;
}

.brand-logo {
  display: block;
  width: auto;
  height: clamp(1.7rem, 3vw, 2.25rem);
  margin: 0 auto;
  object-fit: contain;
}

#app-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.view {
  height: 100%;
  min-height: 0;
}

.view:not([hidden]) {
  animation: view-in 220ms ease both;
}

.home-view:not([hidden]),
.supply-view:not([hidden]) {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 12px clamp(16px, 2.5vw, 40px) 48px;
}

.home-layout {
  display: grid;
  grid-template-columns:
    minmax(205px, 1fr)
    minmax(230px, 0.95fr)
    minmax(205px, 1fr);
  align-items: center;
  gap: clamp(24px, 4.4vw, 50px);
  width: 100%;
  max-width: 1100px;
  margin: 0;
  padding: 0;
  transform: translateY(36px);
}

.module-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 268px;
  height: min(414px, 52vh);
  min-height: 300px;
  justify-self: center;
  padding: 29px 16px;
  background: var(--panel);
  border-radius: 10px;
}

.module-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 8px 14px;
  overflow: hidden;
  color: #f6f7f8;
  font-size: clamp(0.77rem, 1.25vw, 0.91rem);
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--ink);
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(52, 58, 69, 0.05);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.module-button:hover {
  background: var(--panel-hover);
  box-shadow: 0 7px 14px rgba(54, 62, 76, 0.17);
  transform: translateY(-2px);
}

.module-button:active {
  box-shadow: none;
  transform: translateY(0);
}

.module-link {
  cursor: pointer;
}

.gerencial-hub {
  position: relative;
  display: grid;
  place-items: center;
  width: min(190px, 80%);
  aspect-ratio: 1;
  justify-self: center;
  overflow: hidden;
  color: #ffffff;
  text-align: center;
  background: #c7c8cb;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(86, 93, 103, 0.03);
  transition:
    box-shadow 180ms ease,
    transform 180ms ease,
    background-color 180ms ease;
}

.gerencial-hub:hover {
  background: #bfc1c5;
  box-shadow:
    inset 0 0 0 1px rgba(86, 93, 103, 0.08),
    0 12px 24px rgba(77, 84, 96, 0.18);
  transform: scale(1.025);
}

.hub-watermark {
  position: absolute;
  inset: 16%;
  display: grid;
  place-items: center;
  opacity: 0.22;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.hub-watermark img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
}

.hub-label {
  position: relative;
  z-index: 1;
  font-size: clamp(0.9rem, 1.65vw, 1.12rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.13;
}

.supply-layout {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  justify-items: center;
  width: 100%;
  max-width: 1280px;
  margin: 0;
  transform: translateY(12px);
}

.supply-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 340px);
  text-align: center;
}

.smart-emblem {
  width: clamp(140px, 16vw, 200px);
}

.smart-emblem img {
  display: block;
  width: 100%;
  height: auto;
}

.supply-intro h1 {
  margin: 6px 0 0;
  color: #5f6674;
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.supply-intro p {
  margin: 0;
  color: #7a8190;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 400;
  line-height: 1.15;
}

.supply-divider {
  width: 1px;
  height: min(430px, 52vh);
  background: #9aa0a8;
  opacity: 0.85;
  justify-self: center;
}

.supply-content {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
}

.supply-visual {
  position: relative;
  width: min(100%, 460px);
  aspect-ratio: 1;
}

.sector {
  --petal-w: 52%;
  --petal-h: 54%;
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: var(--petal-w);
  height: var(--petal-h);
  padding: 0;
  margin: 0;
  overflow: visible;
  color: #2a2e38;
  font-size: clamp(0.88rem, 1.5vw, 1.08rem);
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transform-origin: 50% 100%;
  transition: transform 160ms ease;
}

.sector-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  fill: rgba(176, 179, 186, 0.9);
  transition: fill 160ms ease;
}

.sector:hover {
  z-index: 4;
}

.sector:hover .sector-shape {
  fill: rgba(154, 158, 168, 0.98);
}

.sector-label {
  position: relative;
  z-index: 1;
  max-width: 7.2em;
  margin-bottom: 48%;
  pointer-events: none;
}

.sector-icon {
  position: absolute;
  z-index: 3;
  bottom: 18%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 26%;
  height: 22%;
  color: #1a1d24;
  pointer-events: none;
  transform: translateX(-50%);
}

.sector-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sector-top {
  transform: translate(-50%, -100%) rotate(0deg);
}

.sector-top:hover {
  transform: translate(-50%, -100%) rotate(0deg) translateY(-3px);
}

.sector-left {
  transform: translate(-50%, -100%) rotate(-120deg);
}

.sector-left:hover {
  transform: translate(-50%, -100%) rotate(-120deg) translateY(-3px);
}

.sector-left .sector-label {
  transform: rotate(120deg);
}

.sector-left .sector-icon {
  transform: translateX(-50%) rotate(120deg);
}

.sector-right {
  transform: translate(-50%, -100%) rotate(120deg);
}

.sector-right:hover {
  transform: translate(-50%, -100%) rotate(120deg) translateY(-3px);
}

.sector-right .sector-label {
  transform: rotate(-120deg);
}

.sector-right .sector-icon {
  transform: translateX(-50%) rotate(-120deg);
}

.orbit-core {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 34%;
  height: 34%;
  overflow: hidden;
  pointer-events: none;
  background: rgba(112, 118, 130, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.footer {
  position: relative;
  display: flex;
  flex: 0 0 33px;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  padding: 0 24px 6px;
  color: rgba(255, 255, 255, 0.72);
  background: var(--brand-green);
}

.footer p {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  font-size: clamp(0.47rem, 0.75vw, 0.62rem);
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tehokas-brand {
  position: absolute;
  top: -58px;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transform: translateX(-50%);
  transition: transform 160ms ease;
}

.tehokas-brand:hover {
  transform: translateX(-50%) translateY(-2px);
}

.tehokas-logo {
  display: block;
  width: auto;
  height: clamp(2.1rem, 3.6vw, 2.7rem);
  object-fit: contain;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 22px;
  bottom: 22px;
  max-width: min(340px, calc(100vw - 44px));
  padding: 11px 15px;
  color: #ffffff;
  font-size: 0.82rem;
  line-height: 1.35;
  pointer-events: none;
  visibility: hidden;
  background: var(--brand-green-dark);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 9px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;
}

.toast.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    align-content: center;
    gap: 24px;
  }

  .gerencial-hub {
    grid-column: 1 / -1;
    grid-row: 1;
    width: min(170px, 54%);
  }

  .home-layout .module-panel {
    grid-row: 2;
    height: 350px;
    min-height: 0;
  }

  .supply-layout {
    grid-template-columns: 1fr 1px 1fr;
  }

  .supply-visual {
    width: min(100%, 380px);
  }

  .supply-divider {
    height: min(340px, 46vh);
  }

  .smart-emblem {
    width: clamp(120px, 14vw, 160px);
  }
}

@media (max-width: 640px) {
  .site-frame {
    padding: 10px 10px 0;
  }

  .app-card {
    min-height: calc(100vh - 10px);
    min-height: calc(100svh - 10px);
    border-radius: 12px 12px 0 0;
  }

  .topbar {
    height: 62px;
    padding-top: 13px;
  }

  .home-view:not([hidden]),
  .supply-view:not([hidden]) {
    display: block;
    height: auto;
    min-height: 100%;
    overflow-y: auto;
    padding: 18px 16px 72px;
  }

  .home-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    align-content: start;
    gap: 18px;
    padding: 0;
  }

  .gerencial-hub {
    grid-column: auto;
    grid-row: auto;
    width: 150px;
  }

  .home-layout .module-panel {
    grid-row: auto;
    max-width: 360px;
    height: auto;
    min-height: 0;
    gap: 11px;
    padding: 17px 14px;
  }

  .module-button {
    min-height: 40px;
    font-size: 0.84rem;
  }

  .supply-layout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 22px;
  }

  .supply-intro {
    width: auto;
  }

  .smart-emblem {
    width: 112px;
  }

  .supply-intro h1 {
    font-size: 1.85rem;
  }

  .supply-intro p {
    font-size: 1.18rem;
  }

  .supply-divider {
    width: min(280px, 80%);
    height: 1px;
  }

  .supply-content {
    width: 100%;
  }

  .supply-visual {
    width: min(100%, 340px);
  }

  .footer {
    flex-basis: 36px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .footer p {
    font-size: 0.43rem;
  }

  .tehokas-brand {
    top: -56px;
  }

  .tehokas-logo {
    height: 2rem;
  }
}

@media (max-width: 430px) {
  .home-layout {
    padding-right: 15px;
    padding-left: 15px;
  }

  .supply-visual {
    width: min(100%, 300px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
