body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.hero p {
  margin: 0 0 8px;
  color: #67e8f9;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 52px);
}

.hero span {
  color: #cbd5e1;
  line-height: 1.7;
}

.language-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.language-switch button,
.panel-tabs button,
.section-heading button,
.inline-form button,
.stack-form button,
#adapters-panel button {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 800;
}

.panel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.panel-tabs button.is-active,
.section-heading button,
.inline-form button,
.stack-form button,
#adapters-panel button {
  background: linear-gradient(135deg, #22d3ee, #34d399);
  color: #06211b;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.grid,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.card,
.wide-card,
.summary-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.wide-card {
  padding: 28px;
  margin-bottom: 16px;
}

.card h2,
.wide-card h2 {
  margin: 0 0 10px;
  color: #f8fafc;
}

.card p,
.wide-card p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.65;
}

.summary-card strong {
  display: block;
  font-size: 34px;
  color: #67e8f9;
}

.summary-card span {
  display: block;
  color: #cbd5e1;
  margin-top: 8px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.inline-form,
.stack-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  padding: 12px 14px;
  font: inherit;
}

select option {
  background: #0f172a;
  color: #e2e8f0;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

pre {
  white-space: pre-wrap;
  overflow: auto;
  padding: 16px;
  margin-top: 16px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #bfdbfe;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .hero,
html[dir="rtl"] .panel-tabs,
html[dir="rtl"] .wide-card {
  text-align: right;
}

@media (max-width: 760px) {
  .hero,
  .section-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .language-switch {
    justify-content: flex-start;
  }

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


.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.action-row button {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(34, 211, 238, 0.18);
  color: #e2e8f0;
  cursor: pointer;
  font-weight: 800;
}

.muted-line {
  margin-top: 12px;
  color: #94a3b8;
  font-size: 14px;
}

.error-line {
  margin-top: 12px;
  color: #fca5a5;
  font-size: 14px;
}


/* TL CMMS public layout: left navigation column, right work area. */
@media (min-width: 980px) {
  .shell {
    width: min(1480px, calc(100% - 40px));
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-areas:
      "nav hero"
      "nav content";
    gap: 22px 24px;
    align-items: start;
    margin: 0 auto;
    padding: 32px 0;
  }

  .hero {
    grid-area: hero;
    min-height: 140px;
  }

  .panel-tabs {
    grid-area: nav;
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 12px;
    margin: 0;
    padding: 18px;
    min-height: calc(100vh - 64px);
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.28);
  }

  .panel-tabs::before {
    content: "TL CMMS";
    display: block;
    margin: 4px 4px 14px;
    color: #67e8f9;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.16em;
  }

  .panel-tabs button {
    width: 100%;
    border-radius: 18px;
    padding: 14px 16px;
    text-align: left;
    justify-content: flex-start;
    background: rgba(30, 41, 59, 0.84);
  }

  .panel-tabs button.is-active {
    background: linear-gradient(135deg, #22d3ee, #34d399);
    color: #06211b;
    box-shadow: 0 10px 26px rgba(45, 212, 191, 0.18);
  }

  .panel {
    grid-area: content;
    min-width: 0;
  }

  .wide-card:first-child {
    margin-top: 0;
  }
}

@media (max-width: 979px) {
  .panel-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 0;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(12px);
  }

  .panel-tabs button {
    white-space: nowrap;
  }
}

html[dir="rtl"] .panel-tabs button {
  text-align: right;
}
