@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap");

:root {
  --pl-bg: #f5f7fc;
  --pl-bg-soft: #ecf1fb;
  --pl-ink: #1a2440;
  --pl-muted: #5f6f96;
  --pl-border: #d5dff3;
  --pl-panel: #ffffff;
  --pl-brand: #1b2b59;
  --pl-brand-2: #324a8a;
  --pl-accent: #2fc3b1;
  --pl-accent-2: #42d9a1;
  --pl-profit: #128c62;
  --pl-loss: #cc334f;
}

:root[data-theme="dark"] {
  --pl-bg: #0f1528;
  --pl-bg-soft: #121b33;
  --pl-ink: #e2e8ff;
  --pl-muted: #a0afd6;
  --pl-border: #2a3a67;
  --pl-panel: #172241;
  --pl-brand: #101938;
  --pl-brand-2: #1f2e5e;
  --pl-accent: #2eb8a7;
  --pl-accent-2: #4fd7b1;
  --pl-profit: #44c08a;
  --pl-loss: #ff6a8c;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--pl-ink);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(860px 260px at 8% -5%, rgba(66, 217, 161, 0.16), transparent 70%),
    radial-gradient(760px 240px at 98% 3%, rgba(50, 74, 138, 0.17), transparent 66%),
    linear-gradient(170deg, var(--pl-bg), var(--pl-bg-soft));
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 120;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: linear-gradient(122deg, rgba(27, 43, 89, 0.96), rgba(50, 74, 138, 0.94));
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(7px);
}

.theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  line-height: 1;
}

.login-indicator-icon {
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.92);
}

.login-indicator-icon svg {
  width: 18px;
  height: 18px;
}

.login-indicator-email {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.brand-wrap {
  display: grid;
  gap: 1px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #072b31;
  background: linear-gradient(130deg, var(--pl-accent), var(--pl-accent-2));
  box-shadow: 0 4px 10px rgba(79, 215, 177, 0.28);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
  color: #0b2f37;
}

.brand {
  color: #ffffff;
  font-family: "Sora", sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.45px;
}

.brand-sub {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #fff;
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
}

.nav-link.active {
  color: #0f2f32;
  background: linear-gradient(130deg, var(--pl-accent), var(--pl-accent-2));
  border-color: rgba(255, 255, 255, 0.26);
}

.nav-link.nav-cta {
  border-color: rgba(66, 217, 161, 0.55);
}

.container {
  max-width: 1220px;
  margin: 24px auto;
  padding: 0 16px 44px;
}

.app-shell {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 16px 0;
}

.app-shell .container {
  max-width: none;
  margin: 0;
  padding: 0 0 44px;
}

.side-nav {
  position: sticky;
  top: 84px;
  align-self: start;
  background: linear-gradient(175deg, rgba(27, 43, 89, 0.98), rgba(50, 74, 138, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 14px 28px rgba(20, 39, 82, 0.23);
}

.side-nav-title {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 8px 10px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88);
  border-radius: 11px;
  padding: 9px 8px;
  border: 1px solid transparent;
  font-weight: 600;
  margin-bottom: 4px;
  transition: all 0.18s ease;
}

.side-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
}

.side-link.active {
  color: #0f2f32;
  background: linear-gradient(130deg, var(--pl-accent), var(--pl-accent-2));
}

.side-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  letter-spacing: 0;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.side-icon svg {
  width: 16px;
  height: 16px;
  color: currentColor;
}

.side-link.active .side-icon {
  background: rgba(15, 47, 50, 0.2);
  color: #0f2f32;
}

.hero {
  border-radius: 18px;
  color: #ffffff;
  padding: 34px;
  background:
    radial-gradient(circle at 12% 20%, rgba(66, 217, 161, 0.2), transparent 42%),
    linear-gradient(130deg, #20336b, #2f4ea0 52%, #2c4a83);
  box-shadow: 0 16px 34px rgba(32, 51, 107, 0.28);
}

.hero h1 {
  margin: 0 0 10px;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.8rem, 2.9vw, 2.55rem);
  letter-spacing: 0.2px;
}

.hero p {
  max-width: 780px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.sales-strip article {
  background: linear-gradient(140deg, rgba(47, 195, 177, 0.08), rgba(50, 74, 138, 0.06));
}

.home-cta {
  margin-top: 16px;
}

.btn.btn-secondary {
  background: linear-gradient(130deg, #2e3f72, #435c9a);
}

.cards article,
.panel,
.metric {
  background: var(--pl-panel);
  border: 1px solid var(--pl-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(30, 60, 120, 0.08);
}

.cards article h3,
.panel h2,
.panel h3,
.metric h4 {
  font-family: "Sora", sans-serif;
}

.cards article p,
.panel p {
  color: var(--pl-muted);
}

.form {
  display: grid;
  gap: 10px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.auth-brand .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.auth-brand h2 {
  margin: 0;
}

.auth-logo-name {
  margin: 0;
  color: var(--pl-text);
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-brand--stack {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 6px;
}

.auth-page-brand {
  margin: 0 auto 14px;
  text-align: center;
}

.auth-page-brand .auth-brand {
  justify-content: center;
  margin-bottom: 6px;
}

.auth-page-brand h2 {
  margin: 0;
}

.auth-back-link {
  text-align: center;
  color: var(--pl-brand);
  font-weight: 600;
  text-decoration: none;
}

.auth-back-link:hover {
  text-decoration: underline;
}

label {
  display: grid;
  gap: 4px;
  color: var(--pl-muted);
  font-size: 0.96rem;
  font-weight: 600;
}

input,
select,
button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--pl-border);
  font: inherit;
  background: #f9fbff;
}

input:focus,
select:focus,
button:focus {
  outline: 2px solid rgba(66, 217, 161, 0.35);
  outline-offset: 1px;
}

.btn {
  border: 0;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(130deg, var(--pl-brand), var(--pl-brand-2));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(50, 74, 138, 0.3);
}

.alert {
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  font-weight: 700;
}

.alert.error {
  color: #8a2336;
  background: #ffedf0;
  border: 1px solid #ffd2da;
}

.alert.success {
  color: #0f7556;
  background: #e8fbf5;
  border: 1px solid #bff0df;
}

.grid-3 {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.premium-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}

.premium-card {
  background: linear-gradient(145deg, rgba(50, 74, 138, 0.05), rgba(47, 195, 177, 0.06));
}

.activity-feed {
  display: grid;
  gap: 8px;
}

.activity-item {
  border: 1px solid var(--pl-border);
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--pl-muted);
  background: rgba(255, 255, 255, 0.4);
}

:root[data-theme="dark"] .activity-item {
  background: rgba(23, 34, 65, 0.9);
}

.metric h4 {
  margin: 0;
  color: var(--pl-muted);
}

.metric p {
  margin: 8px 0 0;
  font-family: "Sora", sans-serif;
  font-size: 1.72rem;
  line-height: 1;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e7ecf7;
}

th {
  color: #4b5b83;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.55px;
}

tr:hover td {
  background: rgba(236, 241, 251, 0.72);
}

:root[data-theme="dark"] tr:hover td {
  background: rgba(34, 49, 88, 0.85);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.smtp-settings-form {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--pl-border);
}

.smtp-settings-form h3 {
  margin: 0;
}

.smtp-settings-form p {
  margin: 0;
  color: var(--pl-muted);
}

.smtp-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.profit {
  color: var(--pl-profit);
  font-weight: 700;
}

.loss {
  color: var(--pl-loss);
  font-weight: 700;
}

#tv_chart {
  height: 420px;
  border-radius: 12px;
  border: 1px solid var(--pl-border);
  overflow: hidden;
}

@media (max-width: 960px) {
  .main-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .theme-toggle {
    align-self: flex-end;
  }

  .header-tools {
    width: 100%;
    justify-content: space-between;
  }

  .header-tools .theme-toggle {
    align-self: auto;
  }

  .app-shell {
    display: block;
    padding-top: 10px;
  }

  .side-nav {
    display: none;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 12px 34px;
  }

  .hero {
    padding: 24px;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .nav-link {
    font-size: 0.92rem;
    padding: 7px 11px;
  }
}
