.auth-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(360px, 520px) 1fr;
  overflow: auto;
  background: #eff6f1;
}

.auth-screen[hidden],
.app-shell[hidden] {
  display: none;
}

.auth-panel {
  z-index: 1;
  min-height: 100%;
  background: #fff;
  padding: clamp(18px, 4vh, 42px) clamp(26px, 5vw, 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-brand img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
}

.auth-brand strong {
  display: block;
  font: 700 17px "Plus Jakarta Sans";
}

.auth-brand small {
  color: #72858a;
  font-size: 11px;
}

.auth-panel h1 {
  margin: 0 0 5px;
  font: 800 27px "Plus Jakarta Sans";
}

.auth-intro {
  max-width: 440px;
  margin: 0 0 16px;
  color: #72858a;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.auth-slogan {
  color: #456c62;
  font-weight: 600;
}

.auth-tabs {
  display: flex;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5ece9;
}

.auth-tab {
  margin-right: 24px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #72858a;
  font: 600 12px inherit;
  cursor: pointer;
}

.auth-tab.active {
  border-bottom-color: #08685c;
  color: #08685c;
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form label {
  gap: 4px;
  font-size: 11px;
}

.auth-form input,
.auth-form select {
  padding: 8px 9px;
}

.auth-form button {
  margin-top: 2px;
  padding: 8px 12px;
}

.auth-message {
  min-height: 0;
  margin: 6px 0 0;
  color: #c55242;
  font-size: 11px;
}

.auth-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #dfeee6;
}

.auth-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  filter: brightness(1.12) saturate(1.07) contrast(1.01);
  transform: scale(1.05);
  animation: auth-background-drift 18s ease-in-out infinite alternate;
}

@keyframes auth-background-drift {
  from { transform: scale(1.05) translate3d(-.45%, -.25%, 0); }
  to { transform: scale(1.085) translate3d(.45%, .25%, 0); }
}

.auth-visual::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background: linear-gradient(0deg, rgba(4, 34, 54, .78), rgba(4, 52, 75, .12) 70%);
}

.auth-copy {
  position: absolute;
  z-index: 2;
  right: 7%;
  bottom: 8%;
  left: 7%;
  color: #fff;
}

.auth-copy h2 {
  margin: 0 0 9px;
  text-shadow: 0 2px 18px rgba(6, 41, 35, .38);
  font: 700 clamp(24px, 3vw, 38px) / 1.25 "Plus Jakarta Sans";
}

.auth-copy p {
  margin-bottom: 0;
  color: #d7ebe4;
  text-shadow: 0 1px 10px rgba(6, 41, 35, .32);
}

.session-button {
  border: 0;
  background: transparent;
  color: #08685c;
  font: 600 11px inherit;
  cursor: pointer;
}

.crud-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.crud-form .full {
  grid-column: 1 / -1;
}

.crud-form input,
.crud-form select,
.crud-form textarea {
  width: 100%;
}

.crud-form input[readonly] {
  cursor: not-allowed;
  background: #eef7f2;
  color: #08685c;
  font-weight: 700;
}

.field-note {
  color: #72858a;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
}

.umkm-auto-fill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5ece9;
}

.umkm-auto-fill .outline-button {
  padding: 8px 11px;
}

#umkm-recommendation-status {
  color: #72858a;
  font-size: 10px;
  text-align: right;
}

@media (max-width: 800px) {
  .umkm-auto-fill {
    align-items: flex-start;
    flex-direction: column;
  }

  #umkm-recommendation-status {
    text-align: left;
  }
}

.modal-heading .close:disabled,
.modal-actions button:disabled {
  cursor: wait;
  opacity: .65;
}

@keyframes dashboard-card-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes dashboard-bar-grow {
  from { transform: scaleY(.03); }
  to { transform: scaleY(1); }
}

@keyframes dashboard-progress-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

#dashboard-view.dashboard-animate .metrics article,
#dashboard-view.dashboard-animate .content-grid .panel {
  animation: dashboard-card-in .52s cubic-bezier(.2,.8,.2,1) both;
}

#dashboard-view.dashboard-animate .metrics article:nth-child(2) { animation-delay: 75ms; }
#dashboard-view.dashboard-animate .metrics article:nth-child(3) { animation-delay: 150ms; }
#dashboard-view.dashboard-animate .metrics article:nth-child(4) { animation-delay: 225ms; }
#dashboard-view.dashboard-animate .content-grid .panel { animation-delay: 190ms; }
#dashboard-view.dashboard-animate .content-grid .panel + .panel { animation-delay: 260ms; }

#dashboard-view.dashboard-animate .bars i {
  transform-origin: bottom;
  animation: dashboard-bar-grow .78s cubic-bezier(.2,.8,.2,1) both;
}

#dashboard-view.dashboard-animate .bars div:nth-child(1) i { animation-delay: 190ms; }
#dashboard-view.dashboard-animate .bars div:nth-child(2) i { animation-delay: 260ms; }
#dashboard-view.dashboard-animate .bars div:nth-child(3) i { animation-delay: 330ms; }
#dashboard-view.dashboard-animate .bars div:nth-child(4) i { animation-delay: 400ms; }
#dashboard-view.dashboard-animate .bars div:nth-child(5) i { animation-delay: 470ms; }
#dashboard-view.dashboard-animate .bars div:nth-child(6) i { animation-delay: 540ms; }

#dashboard-view.dashboard-animate .dusun-list i::after {
  transform-origin: left;
  animation: dashboard-progress-grow .7s cubic-bezier(.2,.8,.2,1) both;
  animation-delay: calc(230ms + var(--delay, 0ms));
}

@media (prefers-reduced-motion: reduce) {
  .auth-visual img,
  .auth-screen::before,
  #dashboard-view.dashboard-animate .metrics article,
  #dashboard-view.dashboard-animate .content-grid .panel,
  #dashboard-view.dashboard-animate .bars i,
  #dashboard-view.dashboard-animate .dusun-list i::after {
    animation: none;
  }
}

.empty-state {
  padding: 36px 20px;
  color: #72858a;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 150;
  right: 24px;
  bottom: 24px;
  padding: 12px 16px;
  border-radius: 6px;
  background: #183f38;
  box-shadow: 0 8px 25px #173b3340;
  color: #fff;
  font-size: 12px;
}

.toast.error {
  background: #a84438;
}

.crud-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}

.crud-actions button {
  padding: 6px 8px;
  border: 1px solid #dce5e1;
  border-radius: 4px;
  background: #fff;
  color: #08685c;
  cursor: pointer;
}

.crud-actions .danger {
  color: #b74e42;
}

.role-badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 10px;
  background: #e7f3ed;
  color: #08685c;
  font-size: 9px;
  text-transform: uppercase;
}

.loading-bar {
  position: fixed;
  z-index: 200;
  top: 0;
  left: 0;
  width: 45%;
  height: 3px;
  background: #b5d840;
  animation: loading 1s infinite alternate;
}

.loading-bar[hidden] {
  display: none;
}

@keyframes loading {
  to {
    transform: translateX(125%);
  }
}

@media (max-width: 760px) {
  .auth-screen {
    display: block;
    isolation: isolate;
    background: #dfeee6;
  }

  .auth-screen::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    content: "";
    background: linear-gradient(rgba(238, 248, 241, .52), rgba(238, 248, 241, .68)), url("media/backgroud.png") center / cover no-repeat;
    animation: auth-mobile-background-drift 20s ease-in-out infinite alternate;
  }

  .auth-visual {
    display: none;
  }

.auth-panel {
    min-height: 100svh;
    padding: 18px 24px;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(5px);
  }

  .crud-form {
    grid-template-columns: 1fr;
  }

  .crud-form .full {
    grid-column: auto;
  }
}

@keyframes auth-mobile-background-drift {
  from { background-position: center 46%; }
  to { background-position: center 54%; }
}

@media (max-height: 720px) {
  .auth-panel {
    justify-content: flex-start;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .auth-brand {
    margin-bottom: 10px;
  }

  .auth-brand img {
    width: 60px;
    height: 60px;
  }

  .auth-panel h1 {
    font-size: 24px;
  }

  .auth-intro {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .auth-tabs {
    margin-bottom: 8px;
  }

  .auth-tab {
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .auth-form {
    gap: 6px;
  }

  .auth-form input,
  .auth-form select {
    padding: 6px 8px;
  }
}
