/* Gny Partner — professional ops shell */
:root {
  --bg: #070d18;
  --bg-elev: #0b1220;
  --surface: rgba(17,24,39,.88);
  --surface-solid: #111827;
  --surface-2: #0f172a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148,163,184,.16);
  --primary: #3b82f6;
  --primary-soft: rgba(59,130,246,.16);
  --accent: #10b981;
  --accent-soft: rgba(16,185,129,.14);
  --warn: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 18px 50px rgba(0,0,0,.35);
  --radius: 16px;
  --font: "Source Sans 3", system-ui, sans-serif;
  --display: "Outfit", system-ui, sans-serif;
  --sidebar-w: 268px;
}
html[data-theme="light"] {
  --bg: #e8eef6;
  --bg-elev: #f4f7fb;
  --surface: rgba(255,255,255,.92);
  --surface-solid: #ffffff;
  --surface-2: #f7f9fc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #d5dee9;
  --primary: #2563eb;
  --primary-soft: rgba(37,99,235,.1);
  --accent-soft: rgba(16,185,129,.1);
  --shadow: 0 14px 40px rgba(15,23,42,.08);
}
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(37,99,235,.22), transparent 55%),
    radial-gradient(700px 380px at 92% 0%, rgba(16,185,129,.1), transparent 50%),
    var(--bg);
  line-height: 1.55;
}
html[data-theme="light"] body {
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(37,99,235,.1), transparent 55%),
    radial-gradient(700px 380px at 92% 0%, rgba(16,185,129,.07), transparent 50%),
    var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}
.shell--full { grid-template-columns: 1fr; }
.shell--full .side { display: none; }

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1.35rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand-row { display: flex; align-items: center; gap: .75rem; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), #1d4ed8);
  display: grid; place-items: center; color: #fff; font-weight: 800;
  font-family: var(--display); letter-spacing: -.03em;
}
.brand-text span {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
.brand-text small { color: var(--muted); font-size: .72rem; }
.toggles { display: flex; align-items: center; gap: .4rem; }
.toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.25rem; height: 2.25rem; padding: 0 .55rem;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font-weight: 700; font-size: .75rem; text-decoration: none;
}
.toggle-btn:hover { border-color: var(--primary); text-decoration: none; }
.toggle-btn svg { width: 1rem; height: 1rem; }
.menu-toggle { display: none; }

.side {
  grid-row: 2;
  padding: 1.15rem .85rem 1.4rem;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  display: flex; flex-direction: column; gap: .35rem;
}
.side-brand { padding: .35rem .65rem 1rem; }
.side-brand strong { display: block; font-family: var(--display); font-size: 1rem; }
.side-brand small { color: var(--muted); font-size: .75rem; }
.nav {
  display: flex; align-items: center; gap: .65rem;
  padding: .72rem .85rem; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: .9rem;
  text-decoration: none; transition: .15s ease;
}
.nav svg { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.nav:hover { background: var(--primary-soft); color: var(--text); text-decoration: none; }
.nav.active {
  background: linear-gradient(90deg, var(--primary-soft), transparent);
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--primary);
}
.nav.out { margin-top: auto; color: #fca5a5; }
.nav.out:hover { background: rgba(239,68,68,.12); color: #fecaca; }

.main {
  grid-row: 2;
  padding: 1.5rem 1.6rem 2.5rem;
  max-width: 1180px;
  width: 100%;
  animation: fadeUp .35s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.page-head { margin-bottom: 1.25rem; }
.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -.03em;
}
.page-head p { margin: .35rem 0 0; color: var(--muted); max-width: 52ch; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.1rem;
  backdrop-filter: blur(10px);
}
.card h2, .card h3 {
  margin: 0 0 .45rem;
  font-family: var(--display);
  letter-spacing: -.02em;
  font-size: 1.08rem;
}
.sub { color: var(--muted); font-size: .9rem; margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1.05rem; border-radius: 12px; border: 0;
  background: var(--primary); color: #fff; font-weight: 700;
  cursor: pointer; text-decoration: none; font-size: .9rem;
  box-shadow: 0 10px 28px rgba(59,130,246,.25);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.ghost {
  background: transparent; border: 1px solid var(--line);
  color: var(--text); box-shadow: none;
}
.btn.accent { background: var(--accent); color: #042f2e; box-shadow: 0 10px 28px rgba(16,185,129,.22); }
.btn-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .85rem; }

label { display: block; margin: .75rem 0 .3rem; font-size: .78rem; color: var(--muted); font-weight: 700; }
input, select, textarea {
  width: 100%;
  padding: .75rem .9rem;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}
.check-line {
  display: flex; align-items: center; gap: .5rem;
  margin: .75rem 0 .25rem; color: var(--muted); font-size: .88rem;
}
.check-line input { width: auto; }

.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .72rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th {
  color: var(--muted); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .04em; background: var(--surface-2);
}
.table tr:last-child td { border-bottom: 0; }

.grid-2, .grid-3 { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.05rem 1.15rem;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute; inset: auto -20% -40% auto;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--primary-soft); pointer-events: none;
}
.stat-card strong {
  display: block;
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: -.02em;
  position: relative;
}
.stat-card small { color: var(--muted); position: relative; }
.stat-card.profit strong { color: #6ee7b7; }
html[data-theme="light"] .stat-card.profit strong { color: #059669; }
.stat-card.cost strong { color: #fcd34d; }
html[data-theme="light"] .stat-card.cost strong { color: #b45309; }

.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .22rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700;
}
.badge.ok { background: var(--accent-soft); color: #6ee7b7; }
.badge.warn { background: rgba(245,158,11,.15); color: #fcd34d; }
.badge.err { background: rgba(239,68,68,.12); color: #fca5a5; }
.badge.muted { background: var(--surface-2); color: var(--muted); }
html[data-theme="light"] .badge.ok { color: #047857; }
html[data-theme="light"] .badge.warn { color: #b45309; }
html[data-theme="light"] .badge.err { color: #b91c1c; }

.alert {
  padding: .85rem 1rem; border-radius: 12px; margin: .75rem 0;
  font-size: .9rem; border: 1px solid var(--line);
}
.alert.ok { background: var(--accent-soft); color: #6ee7b7; }
.alert.err { background: rgba(239,68,68,.12); color: #fca5a5; }
html[data-theme="light"] .alert.ok { color: #047857; }
html[data-theme="light"] .alert.err { color: #b91c1c; }

.pkg-card {
  display: flex; flex-direction: column; gap: .55rem;
  min-height: 100%;
}
.pkg-price {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -.03em;
}
.pkg-price span { font-size: .85rem; color: var(--muted); font-weight: 600; }

.login-body .shell--full .main { padding: 0; max-width: none; }
.login-hero {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem 3rem;
}
.login-grid {
  width: 100%;
  max-width: 980px;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .login-grid { grid-template-columns: 1.05fr .95fr; align-items: stretch; }
}
.login-copy {
  padding: 1.5rem 1.25rem;
}
.login-copy h1 {
  margin: .5rem 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -.04em;
  line-height: 1.15;
}
.login-copy .eyebrow {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .65rem; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
  font-size: .75rem; font-weight: 700;
}
.login-stack { display: flex; flex-direction: column; gap: 1rem; }

@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    display: none;
    position: fixed; inset: 64px 0 auto 0;
    z-index: 35; max-height: calc(100vh - 64px);
    overflow: auto; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .side.is-open { display: flex; }
  .menu-toggle { display: inline-flex; }
  .main { padding: 1.15rem; }
}
