:root {
  --bg: #03100c;
  --bg-soft: #061912;
  --panel: #0a1f18;
  --panel-2: #0f2b21;
  --line: rgba(221, 248, 236, 0.15);
  --line-strong: rgba(221, 248, 236, 0.24);
  --text: #effaf4;
  --muted: #b3c8bd;
  --gold: #f2c14e;
  --gold-2: #b98a23;
  --green: #20d18a;
  --green-soft: rgba(32, 209, 138, 0.16);
  --red: #f6465d;
  --red-soft: rgba(246, 70, 93, 0.14);
  --blue: #7ad7a8;
  --blue-soft: rgba(122, 215, 168, 0.18);
  --violet: #9bd9bf;
  --font: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(242, 193, 78, 0.16), transparent 20%),
    radial-gradient(circle at 88% 12%, rgba(32, 209, 138, 0.18), transparent 24%),
    linear-gradient(135deg, #062116 0%, #04140f 48%, #020807 100%);
  color: var(--text);
  font-family: var(--font);
}

body {
  padding: 18px;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

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

.app-shell {
  width: min(1360px, 100%);
  margin: 0 auto;
}

.topbar,
.section-head,
.panel-head,
.challenge-head,
.top-actions,
.toolbar {
  display: flex;
  align-items: center;
}

.topbar {
  min-height: 52px;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.08rem;
  font-weight: 900;
}

.brand b,
.eyebrow {
  color: var(--gold);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  color: #211600;
  font-weight: 950;
  box-shadow: 0 0 18px rgba(245, 184, 64, 0.34);
}

.top-actions,
.toolbar {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-select {
  min-width: 230px;
  display: grid;
  gap: 5px;
}

.toolbar-select span {
  font-size: 0.72rem;
  font-weight: 850;
}

.toolbar-select select {
  min-height: 40px;
  padding-block: 8px;
}

.state-pill,
.status-chip,
.availability-card {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(230, 237, 245, 0.78);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 800;
}

.guest-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.intro-panel,
.auth-panel,
.panel,
.metric-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(6, 22, 17, 0.94);
  box-shadow: var(--shadow);
}

.intro-panel {
  min-height: 520px;
  padding: 34px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(3, 16, 12, 0.08) 0%, rgba(3, 16, 12, 0.72) 58%, rgba(3, 16, 12, 0.96) 100%),
    url("/images/generated/modang-26-kos-v3.png") center / cover;
}

.intro-panel h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(2.15rem, 5vw, 4.9rem);
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mini-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.availability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
  max-width: 620px;
}

.availability-card {
  display: grid;
  gap: 5px;
  border-radius: 8px;
  padding: 13px 14px;
  background: rgba(3, 16, 12, 0.62);
  backdrop-filter: blur(10px);
}

.availability-card span {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.availability-card strong {
  color: var(--text);
  font-size: 1rem;
}

.availability-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-panel,
.panel {
  border-radius: 8px;
  padding: 20px;
}

.auth-tabs,
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.tabs {
  margin: 22px 0 14px;
}

.tab-btn,
.ghost-btn,
.primary-btn,
.mini-btn,
.icon-btn,
.danger-btn,
.ok-btn {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-weight: 850;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.tab-btn,
.ghost-btn,
.mini-btn,
.danger-btn,
.ok-btn {
  padding: 10px 13px;
}

.tab-btn:hover,
.ghost-btn:hover,
.primary-btn:hover,
.mini-btn:hover,
.icon-btn:hover,
.danger-btn:hover,
.ok-btn:hover {
  transform: translateY(-1px);
}

.tab-btn.is-active {
  border-color: rgba(90, 169, 255, 0.28);
  background: var(--blue-soft);
  color: #eafff2;
}

.primary-btn {
  padding: 11px 14px;
  border: none;
  background: linear-gradient(135deg, var(--gold), #f0a928);
  color: #1a1302;
  box-shadow: 0 12px 28px rgba(245, 184, 64, 0.22);
}

.danger-btn {
  border-color: rgba(246, 70, 93, 0.28);
  background: var(--red-soft);
  color: #ffd2d8;
}

.ok-btn {
  border-color: rgba(22, 199, 132, 0.26);
  background: var(--green-soft);
  color: #c7f6de;
}

.icon-btn {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.form-stack,
.compact-form {
  display: grid;
  gap: 13px;
}

.form-stack {
  margin-top: 18px;
}

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

label {
  display: grid;
  gap: 7px;
}

label span,
.hint,
.subtle {
  color: var(--muted);
}

label span {
  font-size: 0.82rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: rgba(239, 250, 244, 0.055);
  color: var(--text);
  padding: 11px 12px;
  text-overflow: ellipsis;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

select option {
  color: #111827;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(245, 184, 64, 0.45);
  box-shadow: 0 0 0 3px rgba(245, 184, 64, 0.12);
}

.challenge-box,
.bank-box,
.utility-cost-box,
.manager-form-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.utility-cost-box,
.manager-form-box {
  margin-bottom: 14px;
}

.utility-cost-box h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.utility-cost-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.challenge-head,
.panel-head,
.section-head {
  justify-content: space-between;
  gap: 12px;
}

.challenge-head strong {
  flex: 0 0 auto;
  line-height: 1.35;
  white-space: nowrap;
}

.challenge-head .mini-btn {
  flex: 1 1 124px;
  width: auto;
}

.hint {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.feedback {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 13px;
  color: rgba(230, 237, 245, 0.82);
  line-height: 1.5;
}

.feedback.is-danger {
  border-color: rgba(246, 70, 93, 0.28);
  background: var(--red-soft);
  color: #ffc7cf;
}

.feedback.is-ok {
  border-color: rgba(22, 199, 132, 0.26);
  background: var(--green-soft);
  color: #b8f3d5;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.workspace {
  display: grid;
  gap: 16px;
}

.section-head h1,
.panel h2 {
  margin: 0;
}

.section-head h1 {
  font-size: clamp(1.6rem, 3vw, 3rem);
}

.panel h2 {
  font-size: 1.08rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 138px;
  border-radius: 8px;
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.2rem, 2.2vw, 2rem);
  line-height: 1.1;
}

.metric-card p {
  margin: 10px 0 0;
  color: rgba(230, 237, 245, 0.64);
  font-size: 0.82rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: rgba(230, 237, 245, 0.72);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  color: rgba(230, 237, 245, 0.88);
  font-size: 0.92rem;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-chip.is-ok {
  border-color: rgba(22, 199, 132, 0.26);
  background: var(--green-soft);
  color: #bcf3d8;
}

.status-chip.is-warn {
  border-color: rgba(245, 184, 64, 0.3);
  background: rgba(245, 184, 64, 0.1);
  color: #f3d28f;
}

.status-chip.is-danger {
  border-color: rgba(246, 70, 93, 0.28);
  background: var(--red-soft);
  color: #ffc7cf;
}

.compact-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  margin-bottom: 14px;
}

.compact-form input,
.compact-form select {
  min-width: 0;
}

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

.data-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.data-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.data-card p {
  margin: 6px 0;
  color: rgba(230, 237, 245, 0.72);
  line-height: 1.45;
  font-size: 0.9rem;
}

.tenant-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.check-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.check-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

@media (max-width: 1080px) {
  .guest-layout,
  .tenant-grid {
    grid-template-columns: 1fr;
  }

  .intro-panel {
    min-height: 340px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    padding: 12px;
    overflow-x: hidden;
  }

  .app-shell,
  .guest-layout,
  .intro-panel,
  .auth-panel,
  .panel,
  .workspace {
    min-width: 0;
    max-width: 100%;
  }

  .topbar,
  .section-head,
  .panel-head,
  .challenge-head {
    align-items: flex-start;
  }

  .topbar,
  .section-head {
    flex-direction: column;
  }

  .top-actions,
  .toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .intro-panel,
  .auth-panel,
  .panel {
    padding: 16px;
  }

  .intro-panel {
    min-height: 300px;
  }

  .intro-panel h1 {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    font-size: 1.72rem;
    line-height: 1.05;
  }

  .mini-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .availability-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }

  .mini-metrics span {
    min-width: 0;
    text-align: center;
  }

  .auth-tabs,
  .form-grid.two,
  .metric-grid,
  .compact-form,
  .list-grid,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-btn,
  .ghost-btn,
  .primary-btn,
  .mini-btn,
  .danger-btn,
  .ok-btn,
  .toolbar-select {
    width: 100%;
  }

  .challenge-head .mini-btn {
    width: auto;
  }
}
