:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1d1f23;
  --muted: #6b6f78;
  --line: rgba(0,0,0,0.08);
  --brand: #e07a1f;
  --accent: #2f80ed;
  --shadow: 0 14px 40px rgba(0,0,0,0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Sora", system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 10% 0%, rgba(224,122,31,0.08), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(47,128,237,0.06), transparent 40%),
    var(--bg);
  color: var(--text);
}

.auth-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  place-items: center;
  padding: 24px;
  z-index: 50;
}
.auth-screen.show {
  display: grid;
}

.portal-preloader {
  position: fixed;
  inset: 0;
  background: rgba(246, 243, 238, 0.9);
  display: grid;
  place-items: center;
  z-index: 40;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.portal-preloader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.portal-preloader-card {
  display: grid;
  gap: 10px;
  align-items: center;
  justify-items: center;
  padding: 20px 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffaf2;
  box-shadow: var(--shadow);
}

.portal-preloader-mark {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(224, 122, 31, 0.12);
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.12em;
  animation: portalPulse 1.8s ease-in-out infinite;
}

.portal-preloader-text {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.auth-card {
  background: var(--card);
  padding: 26px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: min(420px, 92vw);
  display: grid;
  gap: 12px;
}
.auth-lang {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

.lang-select {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}

.lang-select:focus {
  outline: none;
  border-color: rgba(244, 198, 127, 0.6);
  box-shadow: 0 0 0 2px rgba(244, 198, 127, 0.18);
}
.auth-title {
  font-size: 20px;
  font-weight: 600;
}
.auth-sub {
  font-size: 13px;
  color: var(--muted);
}
.auth-row {
  display: grid;
  gap: 10px;
}
.auth-row input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 14px;
}
.auth-note {
  font-size: 12px;
  color: var(--muted);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px 22px;
  background: #111318;
  color: #f0f0f3;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f6b573, #e07a1f);
  font-weight: 700;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
}

.brand-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

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

.nav-item {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.78);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item.is-active,
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  color: #ffffff;
}

.nav-item:focus-visible {
  outline: none;
  border-color: rgba(224,122,31,0.7);
  box-shadow: 0 0 0 2px rgba(224,122,31,0.25);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 12px;
  text-align: center;
}

.content {
  padding: 32px 36px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.page-title {
  font-size: 26px;
  font-weight: 600;
}

.page-sub {
  color: var(--muted);
  font-size: 13px;
}

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

.primary-btn {
  background: var(--brand);
  border: none;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(224, 122, 31, 0.25);
}

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

.primary-btn:disabled:hover,
.ghost-btn:disabled:hover {
  transform: none;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ghost-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(0,0,0,0.08);
}

.primary-btn:focus-visible,
.ghost-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(224,122,31,0.25);
}

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

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

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

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(0,0,0,0.12);
}

.card.stat {
  display: grid;
  gap: 6px;
}

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

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.value {
  font-size: 22px;
  font-weight: 600;
}

.value.small {
  font-size: 16px;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

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

.check-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed var(--line);
  background: #faf8f4;
}

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

.row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.7fr 0.7fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.row:not(.head):hover {
  background: rgba(0,0,0,0.03);
  border-radius: 10px;
}

.row.head {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-bottom: 1px solid var(--line);
}

.row.domain-row {
  grid-template-columns: 1.2fr 0.6fr 1.4fr auto;
}
.row.empty {
  border-bottom: none;
  color: var(--muted);
  font-size: 13px;
  padding: 14px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e0f5ea;
  color: #1f6f49;
  font-size: 11px;
  font-weight: 600;
}

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

.plan-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 12px;
  background: #fffaf2;
}

.plan-card.highlight {
  border-color: rgba(224,122,31,0.4);
  box-shadow: 0 14px 30px rgba(224,122,31,0.18);
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.plan-name {
  font-size: 16px;
  font-weight: 700;
}

.plan-price {
  font-size: 13px;
  color: var(--muted);
}

.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.plan-features li::before {
  content: "• ";
  color: var(--brand);
}

.plan-actions {
  display: grid;
  gap: 10px;
}

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

.panel {
  display: none;
}

.panel.is-active {
  display: block;
  animation: portalFadeUp 0.28s ease;
}

@keyframes portalFadeUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes portalPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(224,122,31,0.0);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 18px rgba(224,122,31,0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(224,122,31,0.0);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 16, 18, 0.45);
  z-index: 40;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal.is-open {
  display: flex;
  opacity: 1;
}

.modal-card {
  width: min(520px, 92vw);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  display: grid;
  gap: 16px;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}

.modal-card-wide {
  width: min(720px, 94vw);
}

.modal.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-body {
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.status {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; align-items: center; }
  .nav { display: flex; flex-wrap: nowrap; }
  .content { padding: 24px; }
  .grid-3, .grid-2, .plan-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .auth-lang {
    top: 12px;
    right: 12px;
  }
}
