:root{
  --bg: #0B1530;
  --card: #0F1E3D;
  --ink: #E8EEF9;
  --muted: #B7C5E6;
  --gold: #C9A227;
  --line: rgba(255,255,255,.12);
  --shadow: 0 14px 32px rgba(0,0,0,.25);
}

*{ box-sizing: border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 10% 10%, #162a5d 0%, var(--bg) 55%) fixed;
  color: var(--ink);
}

.page{ max-width: 1200px; margin: 0 auto; padding: 16px; }

.top{
  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 14px;
}

.brand .title{ font-size: 26px; font-weight: 800; letter-spacing: .2px; }
.brand .subtitle{ color: var(--muted); margin-top: 4px; }
.brand .rights{ color: var(--gold); margin-top: 8px; font-weight: 700; font-size: 13px; }

.logo img{
  max-width: 260px;
  max-height: 96px;
  object-fit: contain;
  display:block;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.25));
}

.grid{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap: 14px;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
  .logo{ display:none; }
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.card h2{
  margin: 0 0 12px 0;
  color: var(--gold);
  font-size: 18px;
}

.sectionTitle{
  margin: 14px 0 8px 0;
  color: var(--muted);
  font-weight: 800;
}

.formRow{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom: 10px;
}

.formRow.cols{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:10px;
}

label{ color: var(--muted); font-size: 13px; }

input, select{
  width:100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0E2042;
  color: var(--ink);
  outline: none;
}

input:focus, select:focus{ border-color: rgba(201,162,39,.65); }

.btnRow{ display:flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.btn{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight: 800;
}
.btn:hover{ border-color: rgba(201,162,39,.45); }
.btn.primary{
  background: linear-gradient(180deg, #E0B84C, var(--gold));
  color:#0b1020;
  border-color: rgba(0,0,0,.2);
}
.btn.ghost{
  background: transparent;
}

.note{
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed rgba(201,162,39,.35);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(0,0,0,.12);
}

.tableWrap{
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #0E2042;
}

table{ width:100%; border-collapse: collapse; }
th, td{
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}
th{
  background: #10254A;
  color: var(--ink);
  text-align: left;
}
td{ background: #0E2042; }
tr:hover td{ background: rgba(255,255,255,.03); }

.center{ text-align:center; }
.num{ text-align:right; font-variant-numeric: tabular-nums; }

td.action{ width: 120px; }

.summary{
  background: #0E2042;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  min-height: 120px;
  white-space: pre-wrap;
}

.status{
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.14);
  font-weight: 700;
}
.status.good{ color: var(--muted); }
.status.bad{ color: #ffb3c1; border-color: rgba(255,77,109,.45); }

.foot{
  margin-top: 12px;
  color: rgba(232,238,249,.65);
  text-align:center;
  font-size: 12px;
}

/* --- Scroll за много съдружници --- */
.partners .tableWrap{
  max-height: 320px;
  overflow: auto;
}

/* --- Live validation --- */
input.invalid, select.invalid{
  border-color: #ff4d6d !important;
  background: #3A1830 !important;
}
input.ok, select.ok{
  border-color: rgba(255,255,255,.12);
}

/* --- FIX: гаранция input-ите да са кликаеми (без overlay) --- */
#partnersTable { position: relative; }
#partnersTable th { z-index: 1; }
#partnersTable td { position: relative; z-index: 2; }
#partnersTable input, #partnersTable button { position: relative; z-index: 3; pointer-events: auto; }
