:root {
  --bg: #eef2e8;
  --bg-accent: #d8e0cf;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: #ffffff;
  --line: rgba(34, 52, 38, 0.12);
  --text: #1f2b1e;
  --muted: #5f6f5f;
  --brand: #355c3a;
  --brand-strong: #26452a;
  --warn: #a06a16;
  --danger: #a0382b;
  --success: #2c7443;
  --shadow: 0 18px 50px rgba(31, 43, 30, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 28%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-accent) 100%);
}

button,
input {
  font: inherit;
}

.login-body,
.app-body {
  min-height: 100vh;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card,
.panel-card,
.sidebar {
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.login-card {
  width: min(440px, 100%);
  border-radius: 28px;
  padding: 32px;
}

.eyebrow {
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
}

.login-card h1,
.panel-header h1 {
  margin: 12px 0 8px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 0.95;
}

.login-copy,
.panel-header p,
.panel-card p {
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

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

.login-form input,
.search-input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
}

.login-form button,
.logout-button,
.tab-button {
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  transition: 0.2s ease;
}

.login-form button,
.logout-button {
  padding: 14px 18px;
  background: var(--brand);
  color: white;
  font-weight: 700;
}

.login-form button:hover,
.logout-button:hover {
  background: var(--brand-strong);
}

.back-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  padding: 18px;
}

.sidebar {
  border-radius: 28px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.nav-tabs {
  display: grid;
  gap: 12px;
}

.tab-button {
  text-align: left;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  font-weight: 700;
}

.tab-button.active,
.tab-button:hover {
  background: var(--brand);
  color: white;
}

.content {
  min-width: 0;
}

.tab-panel {
  display: none;
  min-height: calc(100vh - 36px);
  padding: 24px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid var(--line);
}

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

.panel-header {
  margin-bottom: 24px;
}

.hero-card {
  padding: 28px;
}

.api-card {
  padding: 24px;
  margin-bottom: 16px;
}

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

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

.field-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.field-wide {
  grid-column: 1 / -1;
}

.api-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.api-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 600;
}

.api-summary {
  margin-bottom: 16px;
}

.summary-card,
.empty-card {
  padding: 20px;
  border-radius: 24px;
  margin-bottom: 16px;
}

.summary-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.job-results {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.job-card {
  padding: 22px;
  border-radius: 24px;
}

.job-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.job-card-top h2,
.empty-card h2 {
  margin: 0 0 8px;
}

.job-company {
  margin: 0;
  font-weight: 700;
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.job-tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(53, 92, 58, 0.1);
  color: var(--brand-strong);
  font-weight: 700;
  white-space: nowrap;
}

.job-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 14px;
  color: var(--muted);
}

.job-description,
.job-benefits {
  margin: 0 0 14px;
}

.job-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--brand);
  color: white;
  text-decoration: none;
  font-weight: 700;
}

.job-link:hover {
  background: var(--brand-strong);
}

.api-result {
  margin: 0;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(18, 33, 20, 0.9);
  color: #e7f4e8;
  overflow: auto;
  min-height: 280px;
  box-shadow: var(--shadow);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.status-card,
.account-card {
  padding: 22px;
  border-radius: 24px;
}

.account-grid {
  display: grid;
  gap: 16px;
}

.telegram-card {
  display: grid;
  gap: 18px;
}

.account-section-header h2 {
  margin: 0 0 8px;
}

.account-section-header p {
  margin: 0;
}

.telegram-form {
  display: grid;
  gap: 16px;
}

.telegram-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.telegram-meta-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line);
}

.telegram-meta-item-wide {
  grid-column: 1 / -1;
}

.telegram-meta-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.telegram-meta-item strong {
  display: block;
  word-break: break-word;
}

.telegram-result {
  min-height: 220px;
}

.status-card h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 18px;
}

.status-card.success {
  border-color: rgba(44, 116, 67, 0.25);
}

.status-card.warning {
  border-color: rgba(160, 106, 22, 0.25);
}

.status-card.danger {
  border-color: rgba(160, 56, 43, 0.25);
}

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

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

  .sidebar {
    padding: 18px;
  }

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

  .tab-button {
    text-align: center;
  }

  .tab-panel {
    min-height: auto;
  }

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

  .job-card-top {
    flex-direction: column;
  }
}
