:root {
  color-scheme: dark;
  font-family: Inter, Segoe UI, Roboto, Ubuntu, Cantarell, Arial, sans-serif;
  line-height: 1.4;
  --bg: #071121;
  --bg-alt: #0b1d35;
  --panel: #102845;
  --panel-soft: #17365a;
  --line: #2a4d76;
  --text: #d7e8ff;
  --muted: #9eb9d9;
  --accent: #2e7fe8;
  --accent-soft: #4a99ff;
  --error: #ff7f7f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top right, #103861 0%, var(--bg) 40%, #060d18 100%);
  color: var(--text);
}

a {
  color: var(--accent-soft);
}

.screen {
  min-height: 100vh;
}

.screen.is-hidden,
.loading-retry.is-hidden,
.nav-button.is-hidden,
.page-form-view.is-hidden,
.page-list-view.is-hidden {
  display: none;
}

.loading-screen,
.login-screen,
.bootstrap-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.loading-card,
.login-card {
  width: min(420px, 100%);
}

.bootstrap-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

.login-title {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  text-align: center;
}

.login-subtitle {
  margin: 0 0 1.25rem;
  text-align: center;
}

.loading-title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  text-align: center;
}

.loading-card .button {
  margin-top: 0.85rem;
  width: 100%;
}


.bootstrap-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.form-column {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.form-column label {
  color: var(--muted);
  font-size: 0.84rem;
}

.form-column .button-primary {
  margin-top: 0.35rem;
}

.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(170deg, #0f2744, #0d2037 60%, #0c1b2f);
}

.top-bar h1 {
  margin: 0;
  font-size: 1.45rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.subtitle,
.muted {
  color: var(--muted);
  margin: 0.2rem 0 0;
}

.app-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
  flex: 1;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(16, 40, 69, 0.88), rgba(11, 29, 53, 0.88));
  align-self: start;
  position: sticky;
  top: 1rem;
}

.nav-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 0.9rem;
}

.nav-button:hover {
  background: rgba(61, 139, 253, 0.12);
}

.nav-button.is-active {
  background: rgba(46, 127, 232, 0.23);
  border-color: var(--accent);
  color: #e8f2ff;
  font-weight: 600;
}

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

.page {
  display: none;
}

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

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.section-title {
  margin: 0;
  font-size: 1.05rem;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 40, 69, 0.88), rgba(11, 29, 53, 0.88));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem;
  margin-bottom: 0.9rem;
}

.input-with-help {
  position: relative;
}

.input-with-help select {
  padding-right: 2rem;
}

.info-icon {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 1px solid #4f77a7;
  color: #b8d4f7;
  background: #0f2a49;
  font-size: 0.72rem;
  line-height: 0.95rem;
  text-align: center;
  cursor: help;
  user-select: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0a1b31;
  color: var(--text);
  padding: 0.5rem 0.6rem;
}

select[multiple],
textarea {
  min-height: 7.5rem;
  resize: vertical;
  overflow: auto;
}

.button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #1a416b, #143457);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.button-primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--accent-soft), var(--accent));
  color: #031225;
  font-weight: 700;
}

.button-danger {
  border-color: transparent;
  background: linear-gradient(180deg, #ff9a9a, #e85c5c);
  color: #2a0a0a;
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid rgba(74, 119, 171, 0.5);
  padding: 0.52rem 0.48rem;
  font-size: 0.83rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: #c4ddff;
  background: rgba(11, 27, 46, 0.9);
}

tr:hover td {
  background: rgba(32, 71, 114, 0.33);
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.button-small {
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
}

.code {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem;
  background: rgba(9, 21, 37, 0.9);
  color: #cce2ff;
  overflow-x: auto;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.inline-field {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inline-field .button {
  flex: 0 0 auto;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 1rem;
}

.status-bar p {
  margin: 0;
}

.is-error {
  color: var(--error);
}

.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.toast {
  min-width: 260px;
  max-width: 420px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(11, 29, 53, 0.96);
  padding: 0.7rem 0.8rem;
  color: var(--text);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.33);
}

.toast.is-error {
  border-color: #a94242;
  color: #ffd4d4;
}

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

  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .nav-button {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding: 0.75rem;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
