/* file: control_v11.css */

:root{
  --bg:#061006;
  --panel:#081a0a;
  --text:#c9ffd0;
  --muted:#7adf86;
  --green:#16ff4b;
  --danger:#ff3b3b;

  --border: rgba(22,255,75,.22);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: radial-gradient(1200px 700px at 20% 0%, rgba(22,255,75,.10), transparent 55%),
              radial-gradient(900px 600px at 90% 10%, rgba(0,201,58,.08), transparent 60%),
              linear-gradient(180deg, #040b04, var(--bg));
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

.app{
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(3,10,4,.92), rgba(3,10,4,.78));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 12px;
}

.topbarRow{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}

.brand{
  display:flex;
  gap:10px;
  align-items:center;
  user-select:none;
}
.logoDot{
  width:12px; height:12px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(22,255,75,.55);
}
.brandTitle{
  font-weight: 700;
  letter-spacing: .6px;
}
.brandSub{
  color: var(--muted);
  font-size: 12px;
  margin-top: 1px;
}

.nav{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.btn{
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(12,40,16,.92), rgba(6,20,8,.92));
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px;
  cursor:pointer;
  transition: transform .05s ease, box-shadow .12s ease, border-color .12s ease;
  font-weight: 600;
  font-size: 13px;
}
.btn:hover{
  border-color: rgba(22,255,75,.42);
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.btn:active{ transform: translateY(1px); }
.btn.primary{
  border-color: rgba(22,255,75,.55);
  box-shadow: 0 0 18px rgba(22,255,75,.10);
}
.btn.ghost{
  background: rgba(7,20,8,.55);
}
.btn.danger{
  border-color: rgba(255,59,59,.45);
  background: linear-gradient(180deg, rgba(55,10,10,.65), rgba(20,5,5,.75));
}
.btn[disabled]{
  opacity: .55;
  cursor: not-allowed;
}

.badge{
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(7,20,8,.55);
}

.content{
  margin-top: 14px;
  padding-bottom: 32px;
}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.card{
  grid-column: span 12;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(8,26,10,.92), rgba(5,16,7,.92));
  box-shadow: var(--shadow);
  overflow:hidden;
}

.cardHeader{
  padding: 12px 14px;
  border-bottom: 1px solid rgba(22,255,75,.14);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.cardTitle{
  font-weight: 800;
  letter-spacing: .4px;
}
.cardBody{
  padding: 14px;
}

.kv{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  color: var(--muted);
  font-size: 13px;
}
.kv b{ color: var(--text); }

.outputsToolbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 12px;
}
.outputsToolbarLeft,
.outputsToolbarRight{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.outputsGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 900px){
  .outputsGrid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .outputsGrid{ grid-template-columns: 1fr; }
}

.outputTile{
  border: 1px solid rgba(22,255,75,.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(6,20,8,.82), rgba(4,12,6,.92));
  padding: 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.outputLeft{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.outputName{
  font-weight: 800;
  font-size: 14px;
}
.outputMeta{
  font-size: 12px;
  color: var(--muted);
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.pill{
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(22,255,75,.20);
  font-size: 12px;
  color: var(--muted);
  background: rgba(0,0,0,.15);
}
.pill.on{
  color: #081208;
  background: rgba(22,255,75,.92);
  border-color: rgba(22,255,75,.65);
}
.pill.off{
  color: var(--muted);
  background: rgba(0,0,0,.18);
}

.smallBtn{
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.footerNote{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.ruleGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
  margin-top:10px;
}

.ruleTile{
  align-items:flex-start;
  gap:12px;
}

.ruleEditor{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.timePair{
  display:flex;
  gap:6px;
  align-items:center;
}

.timeSelect{
  min-width:72px;
  border: 1px solid rgba(22,255,75,.18);
  border-radius: 10px;
  background: rgba(7,20,8,.8);
  color: var(--text);
  padding: 8px 10px;
}

.timeSelect:disabled{
  opacity:.6;
}

.timeSep{
  color: var(--muted);
  font-weight:700;
}