:root {
  --bg: #08090b;
  --bg-soft: #0f1115;
  --panel: #14171c;
  --panel-2: #111418;
  --line: #2c323b;
  --line-soft: #3a424d;
  --text: #f1f2f6;
  --muted: #9aa3b1;
  --danger: #ff453a;
  --ok: #30d158;
  --focus: #9ca6b5;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.42);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI Variable", "Aptos", "Bahnschrift", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 560px at 90% -15%, #1b1f26 0%, transparent 60%),
    radial-gradient(760px 520px at -10% 95%, #12151a 0%, transparent 58%),
    linear-gradient(170deg, #08090b 0%, #0c0e13 100%);
}

.app-shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.card,
.card-glass {
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card {
  background:
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 1px,
      rgba(0, 0, 0, 0.03) 1px,
      rgba(0, 0, 0, 0.03) 3px
    ),
    linear-gradient(170deg, #191d24 0%, #12161b 55%, #0f1217 100%);
  padding: 20px;
}

.card-glass {
  background:
    linear-gradient(180deg, rgba(30, 35, 43, 0.85) 0%, rgba(17, 21, 27, 0.92) 100%);
  backdrop-filter: blur(5px);
  padding: 14px 16px;
}

.topbar {
  display: grid;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.25) 0%, transparent 58%),
    linear-gradient(150deg, #2d333d 0%, #13161b 100%);
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: block;
}

.brand h1 {
  margin: 0;
  font-size: 1.55rem;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
}

.danger-note {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.menu {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-link {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 10px 16px;
  color: #e0e3ea;
  text-decoration: none;
  font-weight: 700;
  background: linear-gradient(180deg, #232933 0%, #171b22 100%);
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.menu-link:hover {
  transform: translateY(-1px);
  border-color: #596474;
}

.menu-link.is-active {
  background: linear-gradient(180deg, #e7e8ec 0%, #b8bcc5 100%);
  color: #0f1116;
  border-color: #c8ccd4;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.page {
  display: grid;
  gap: 14px;
}

.page h2 {
  margin: 0;
  font-size: 1.12rem;
}

.intro {
  margin: 0;
  color: var(--muted);
}

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

.feature-tile {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(170deg, #1c2129 0%, #12161c 100%);
  transition: transform 140ms ease, border-color 140ms ease;
}

.feature-tile:hover {
  transform: translateY(-2px);
  border-color: #616d7f;
}

.feature-tile h3 {
  margin: 0 0 6px;
}

.feature-tile p {
  margin: 0;
  color: var(--muted);
}

.tile-cta {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

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

input,
select {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #13171d 0%, #0f1318 100%);
  color: var(--text);
}

input[readonly] {
  color: #d9dde6;
}

input[type="file"] {
  background: #151a21;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

button,
.action-link {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
  transition: transform 120ms ease, opacity 120ms ease, border-color 120ms ease;
}

button:hover,
.action-link:hover {
  transform: translateY(-1px);
}

.action-link.is-disabled {
  pointer-events: none;
  opacity: 0.45;
}

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

.btn-primary {
  background: linear-gradient(180deg, #e9eaee 0%, #b9bec7 100%);
  color: #0f1116;
  border-color: #c8ccd4;
}

.btn-ghost,
.action-link.btn-ghost {
  background: linear-gradient(180deg, #242a34 0%, #171c23 100%);
  color: #edf0f7;
  border-color: var(--line-soft);
}

.tool-card {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px;
  background:
    repeating-linear-gradient(
      120deg,
      rgba(255, 255, 255, 0.03) 0px,
      rgba(255, 255, 255, 0.03) 1px,
      rgba(0, 0, 0, 0.03) 1px,
      rgba(0, 0, 0, 0.03) 3px
    ),
    linear-gradient(160deg, #1a1f27 0%, #131820 100%);
}

.tool-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.tool-card ul {
  margin: 0;
  padding-left: 18px;
}

.tool-card li {
  margin: 6px 0;
}

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

.security-grid article {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #1a1f27 0%, #12161d 100%);
}

.security-grid h3 {
  margin: 0 0 6px;
}

.security-grid p {
  margin: 0;
  color: var(--muted);
}

.status-rail {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 16px;
  border: 1px solid var(--line-soft);
}

.status-rail h2 {
  margin: 0;
}

progress {
  width: 100%;
  height: 12px;
}

.status-text {
  margin: 0;
  min-height: 24px;
  color: var(--ok);
  font-weight: 700;
}

.status-text[data-state="busy"] {
  color: #f1f2f6;
}

.status-text[data-state="error"] {
  color: var(--danger);
}

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

  .status-rail {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .card-grid,
  .field-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .menu {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .menu-link {
    white-space: nowrap;
  }
}
