:root{
  --bg:#0c1220;
  --card:#121a2c;
  --text:#e9eefc;
  --muted:#a9b4d6;
  --primary:#1e66d0;
  --border:rgba(255,255,255,.08);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:linear-gradient(180deg,#0b1020,#0a0f1a);
  color:var(--text);
}

a{color:inherit;text-decoration:none}

.app-wrap{width:min(1100px,92vw);margin:0 auto}

/* HEADER — без псевдослоёв */
.app-header{
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: rgba(10,15,26,.75);
  backdrop-filter: blur(10px);
}

.app-header .app-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
}

.brand{display:flex;gap:12px;align-items:center}
.brand img{width:40px;height:40px;object-fit:contain}

.muted{color:var(--muted);font-size:14px}

.card{
  background:rgba(18,26,44,.9);
  border:1px solid var(--border);
  border-radius:18px;
  padding:18px;
  margin:18px 0;
}
.card.hero{padding:22px}

h1{margin:0 0 10px;font-size:26px}
h2{margin:0 0 10px;font-size:18px}

.form .grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:14px;
}
label{display:flex;flex-direction:column;gap:6px;font-size:14px}
input,textarea{
  background:rgba(0,0,0,.25);
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  color:var(--text);
  outline:none;
}
textarea{resize:vertical}
.full{grid-column:1 / -1}

.row{display:flex;gap:10px;align-items:center;margin-top:12px;flex-wrap:wrap}

.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:11px 14px;border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  font-weight:600;
}
.btn.primary{background:var(--primary);border-color:rgba(0,0,0,.15)}
.btn.ghost{background:transparent}

#staffBtn{pointer-events:auto}

/* GRID */
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.actions{display:flex;gap:10px;flex-wrap:wrap}
.foot{padding:18px 0;margin-bottom:16px}

/* MODAL */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 5000;
  pointer-events: none;
}
.modal.is-open{
  display: block;
  pointer-events: auto;
}
.modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
.modal-dialog{
  position: relative;
  width: min(520px, 92vw);
  margin: 10vh auto 0;
  background: rgba(18,26,44,.98);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.modal-close{
  position: absolute;
  top: 10px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  line-height: 36px;
}
.modal-form label{display:flex;flex-direction:column;gap:6px;margin-top:12px}
.modal-form input{
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  outline: none;
}
/* ===== Leads table ===== */
.leads-table{
  width:100%;
  border-collapse: collapse;
  min-width: 820px; /* чтобы на мобиле скроллилось */
}

.leads-table th,
.leads-table td{
  border-bottom: 1px solid var(--border);
  padding: 10px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.leads-table th{
  color: var(--muted);
  font-weight: 600;
}

.leads-table tbody tr:hover{
  background: rgba(255,255,255,.04);
}

/* ===== Status badges ===== */
.badge{
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-size:12px;
  font-weight:600;
}

.badge.new{ background: rgba(255,138,0,.14); }
.badge.work{ background: rgba(30,102,208,.16); }
.badge.done{ background: rgba(0,200,120,.14); }

.btn.sm{
  padding:6px 10px;
  border-radius:10px;
  font-size:12px;
}

/* ===== Filters (select + search) ===== */
.select, .search{
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
}

.select{ cursor: pointer; }
.search{ min-width: 260px; }
/* ===== Quick actions ===== */
.qactions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.qbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  text-decoration:none;
  font-size:16px;
  line-height:1;
}

.qbtn:hover{
  background:rgba(255,255,255,.10);
}


@media (max-width: 820px){
  .form .grid{grid-template-columns:1fr}
  .grid2{grid-template-columns:1fr}
}
